Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

carlospr-dev's avatar
carlospr-dev
New member | Level 2
5 months ago

TypeError with sharingGetSharedLinkFile - res.buffer() is not a function

Environment:

  • dropbox node package version 10.34.0
  • Runtime: Bun

Issue Description: I'm attempting to download a file using by creating a shared link and then retrieving the file content. However, I'm encountering a TypeError when the SDK tries to process the response.

Code:

const link = await dbx.sharingCreateSharedLinkWithSettings({
    path: filePath,
})
const response = await dbx.sharingGetSharedLinkFile({
    url: link.result.url,
})

Error:

3 |       res.blob().then(function (data) {
64 |         return resolve(data);
65 |       });
66 |     } else {
67 |       res.buffer().then(function (data) {
               ^
TypeError: res.buffer is not a function. (In 'res.buffer()', 'res.buffer' is undefined)

The error occurs within the SDK's internal handling of the response object, where it attempts to call res.buffer() but this method is undefined.

Additional Context: I've also attempted using the filesDownload function with the same result. The error appears to be related to the SDK's internal response processing rather than my implementation.

Question: Has anyone encountered this issue before? Is this potentially an environment-specific problem (running Bun instead of Node.js), or am I missing something in my implementation approach?

Any guidance would be greatly appreciated.

3 Replies

About Dropbox API Support & Feedback

Node avatar for 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!