cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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: 

"Dropbox is not a constructor" Nonreasonable Error

"Dropbox is not a constructor" Nonreasonable Error

pyladean
Helpful | Level 5

There is a script which uses Dropbox-sdk.min.js.

The script was fully working yesterday, but today the "Dropbox is not a constructor" error is thrown, although there is the Dropbox object, as planned. Everything MUST work, but it doesn't.

 

SDK is linked in HTML as

<script type="text/javascript" src="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js"></script>

This line throws the error

var dbx = new Dropbox({accessToken: '***************'});

 

Someone, please, help me. I have tried everything therefore I am completely desperate.

1 Accepted Solution

Accepted Solutions

Re: "Dropbox is not a constructor" Nonreasonable Error

pyladean
Helpful | Level 5

UPDATE: The solution is found.

 

I have inspected the Dropbox object and decided to try something. And I was right.

 

Everything works perfect if we use

var dbx = new Dropbox.Dropbox({accessToken: '***'});

instead.

 

I still do not know what in the world happened to the SDK that I was forced to use this workaround.

Thank you. The issue is solved.

 

View solution in original post

4 Replies 4

Re: "Dropbox is not a constructor" Nonreasonable Error

Greg-DB
Dropboxer
Thanks for the report. We're looking into it. I'll follow up here once I have more information on this for you.

Re: "Dropbox is not a constructor" Nonreasonable Error

pyladean
Helpful | Level 5

Thank you. I count on you, because our company and I need this thing work properly as soon as possible.

Re: "Dropbox is not a constructor" Nonreasonable Error

pyladean
Helpful | Level 5

UPDATE: The solution is found.

 

I have inspected the Dropbox object and decided to try something. And I was right.

 

Everything works perfect if we use

var dbx = new Dropbox.Dropbox({accessToken: '***'});

instead.

 

I still do not know what in the world happened to the SDK that I was forced to use this workaround.

Thank you. The issue is solved.

 

View solution in original post

Re: "Dropbox is not a constructor" Nonreasonable Error

Greg-DB
Dropboxer

The API v2 JavaScript SDK just received a major revision that includes breaking changes, with a corresponding major version bump. You can find the release notes here:

 

https://github.com/dropbox/dropbox-sdk-js/releases/tag/v3.0.0

 

This includes a change to how the `Dropbox` object is constructed. In short, as of v3.0.0, you should now use `Dropbox.Dropbox` instead.

 

In order to avoid major version changes from breaking your app, you can instead import specific versions of the library.

 

Exactly how you do so depends on where you're loading the library from.

 

For instance, unpkg has information on specifying particular versions here: https://unpkg.com/

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    pyladean Helpful | Level 5
What do Dropbox user levels mean?
Need more support?