-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class extends value undefined is not a constructor or null #39
Comments
Hi there 👋 I've just followed the same steps again and I can't reproduce the issue. Can you please share your |
Hi, i just created a react app from `npm install ` Package.json is:
node version used is 18.16.0 When i run the application with npm start (npm version 9.5.1) i get the error. This seem to appear every time i recallmsomething from "mpl-candy-machine" package |
Thanks for that, I'm now able to reproduce. Stack Overflow says this is likely caused by a class circular dependency but I've checked all the errors classes inside |
Okay the issue is not related to circular dependencies but to interop issues with ESM and CJS modules. Create-react-app (CRA) imports Umi as an ESM module and One way to fix this would be for us to export all Umi-compatible libraries (such as That being said, most modern web frameworks will resolve dual package imports properly for you. In fact, I tried with NextJS and it works out of the box. If I remember correctly, the latest major version of CRA removed all dual package resolvers at build time and simply assumes that everything uses pure ESM which causes the issue here. I'll close this since In the meantime, I suggest using NextJS for your React app, or extend your CRA's webpack configs. |
Hi @lorisleiva |
Hey, I also had this issue with create-react-app, I was able to solve it with this comment: facebook/create-react-app#12700 (comment) |
Agree that this shouldn't be closed. This lib is the only time I've ever seen this issue with a regular React app, the error message was confusing, and the workaround is pretty intense. I went the craco route, and it caused issues with the polyfills: https://stackoverflow.com/questions/74738438/add-polyfill-to-craco-issue-add-a-fallback-resolve-fallback |
Following the Metaplex guide (https://docs.metaplex.com/programs/candy-machine/getting-started) this error occour in the first step of the getting started:
Specifically the function that generates the error is:
const umi = createUmi("https://metaplex.devnet.rpcpool.com/").use(mplCandyMachine());
Without the ".use" the error goes away but all functions called after on the umi instance return the same error.
The text was updated successfully, but these errors were encountered: