I have just installed Uppy from npm. While trying to initialize it, I am getting this error.
I am using @uppy/core@1.7.1 version. Any idea where I am going wrong?
I have just installed Uppy from npm. While trying to initialize it, I am getting this error.
I am using @uppy/core@1.7.1 version. Any idea where I am going wrong?
@pratikshende I think you might be doing import { Uppy } from '@uppy/core';
? That accesses a transpiled class constructor, which can only be as with new Uppy()
, not as Uppy()
:
import { Uppy } from '@uppy/core';
const uppy = new Uppy(); // works
const uppy = Uppy(); // does not work
We expose a factory function on the default export:
import Uppy from '@uppy/core';
const uppy = Uppy(); // works
This is definitely confusing—the import { Uppy } from '@uppy/core'
style is supposed to check if you’re using new Uppy()
, but it looks like that check is getting omitted for some reason. I’ll have a look into why that happens. Sorry for the trouble!