cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Get thumbnail with TypeScript

Re: Get thumbnail with TypeScript

bffy_smmmers
Explorer | Level 4

hey @Greg-DB - when i try that, i get the following:

 

TypeError: fetch is not a function
at /Users/rosiew/Repositories/backend/packages/rest/.webpack/service/handler.js:441710:16
at processTicksAndRejections (internal/process/task_queues.js:93:5)

12 Replies 12

bffy_smmmers
Explorer | Level 4

Hi @Greg-DB , I wanted to add that the thumbnails work when i try it in isolation using the Dropbox .js example. But not here.  Ireally dont see what i am doing wrong. The function just completely fails with one of these `fetch` errors. No matter what I try.

 

async getThumbnail(path: string😞 Promise<any>{
return this.manager.execute(
async () => {
const data: any = await this.client
.filesGetThumbnail({path: path})
.then((response:any) => {
console.log('got filesGetThumbnail response:');
console.log(response);
console.log('got thumbnail data:');
console.log(response.result.fileBinary)
})
.catch(error => {
console.log('got filesGetThumbnail error:');
console.error(error);
});
return ''
})
}

Greg-DB
Dropbox Staff

Regarding your "fetch is either a Function or undefined" comment, are you saying that in one case "fetch" was actually a function, but you still got the "fetch is not a function"? That would be unexpected. And that in the other case "fetch" was actually undefined? In that case the error would be expected.

 

Anyway, "dropbox_fetch" is not a name used in the SDK. Was that a variable name you set somewhere?

 

In any case, I can't reproduce this issue, so please provide a small sample project that reproduces it so we can look into it here. Thanks!

bffy_smmmers
Explorer | Level 4

hey @Greg-DB  thanks again for all of your help. it turned out to be a webpack issue and not related to the SDK. 

Need more support?