You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
skezh1
11 months agoNew member | Level 2
Re: Uncaught TypeError: Dropbox.Dropbox is not a constructor
Hi! This error reappeared again!
Greg-DB
Dropbox Staff
skezh1 Thanks for the report. The thread you originally posted in was old, so I've moved this to a new thread.
There hasn't been a new release of the Dropbox JavaScript SDK recently, and I'm not seeing this issue in my own testing now.
I'll be happy to help with any issues you're having with the Dropbox API/SDK, but I'll need some more information. Please reply with:
- the name and version number of the platform and SDK/library you are using
- the steps to reproduce the issue, including relevant code snippet(s), but don't include any access or refresh token(s)
- the full text of any error or unexpected output
skezh1
11 months agoNew member | Level 2
Hi Greg and thank you for replying so quickly!
I've built a web app that had been up for a few years and I did not make any recent updates there, but it started to fail today with the "TypeError: Dropbox.Dropbox is not a constructor" error on the "new Dropbox.Dropbox({accessToken: *** })" (Credentials replaced) line.
I've tried updating the SDK version to the latest (10.34.0 now, and I'm using an older version) - this did not fix the issue. SDK version 5.1.0 that did fix this issue last time - also did not help.
Confused, I went to tutorials, and was able to successfully call dropbox from my app with the "basic" example (https://github.com/dropbox/dropbox-sdk-js/tree/main/examples/javascript/basic) , but I could not find the problem still on why this started to happen. I tried to move the line to the global namespace like in the example - this also did not help.
Eventually, I figured that replacing "new Dropbox.Dropbox" with just "new Dropbox" resolved the issue for me - all the functions were there. I've added a try-catch to try both options for now so that my app will continue working.
If I find what the issue was - I will update!
Thank you!
- skezh111 months agoNew member | Level 2
Found the way to reproduce and the issue!
So, the problem happens if the following library is included after Dropbox-sdk.min.js:
https://www.dropbox.com/static/api/2/dropins.js
Please see example here! https://jsfiddle.net/y9dm8oew/
Run it and open the console to see the error.
- Здравко11 months agoLegendary | Level 20
Hi skezh1,
Yes, of course, it's obvious. Both scripts share the same namespace and put there the same name - the last wins. 🙋 That's where your issue is coming from.
By the way you're not using neither Embedder, Saver, or something like... hy at all you need the second script? 🧐 Just to make your life difficult? 😁
A workaround can be seen here if by any chance you need both scripts. 😉
Good luck.
- skezh111 months agoNew member | Level 2
Thank you!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,888 PostsLatest Activity: 2 days agoIf 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 or Facebook.
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!