Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
bffy_smmmers
5 years agoHelpful | Level 5
Re: Get thumbnail with TypeScript
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 processTick...
bffy_smmmers
5 years agoHelpful | Level 5
Greg-DB it is! Using: "node-fetch": "2.6.1".
In the past when I've tried I've received a different error. and i just tried it again and got this: `TypeError: _this.fetch is not a function`.
Greg-DB
Dropbox Community Moderator
5 years agoThanks for checking that. It's not clear why this is failing. Can you inspect what your 'fetch' or '_this.fetch' is in fact, if not a function?
- bffy_smmmers5 years agoHelpful | Level 5
fetch is either a Function or undefined! Greg-DB
- bffy_smmmers5 years agoHelpful | Level 5
Here is an error message to add more context - i dont understanad what "dropbox_fetch" is. When i dont include fetch in the constructor I still receive an error regarding fetch.
21-03-17T20:33:29.417-04:00
Copy
2021-03-18T00:33:29.417Z 74c3d3e2-e0a3-44e1-b49b-253580120ebd INFO TypeError: dropbox_fetch is not a function
at /var/task/handler.js:453612:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
2021-03-18T00:33:29.417Z 74c3d3e2-e0a3-44e1-b49b-253580120ebd INFO TypeError: dropbox_fetch is not a function at /var/task/handler.js:453612:16 at processTicksAndRejections (internal/process/task_queues.js:97:5) - bffy_smmmers5 years agoHelpful | Level 5
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-DB5 years ago
Dropbox Community Moderator
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_smmmers5 years agoHelpful | Level 5
hey Greg-DB thanks again for all of your help. it turned out to be a webpack issue and not related to the SDK.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!