metaplex-foundation / umi

A Solana Framework for JS Clients.
https://umi.typedoc.metaplex.com
MIT License
168 stars 50 forks source link

UMI + mpl-token-metadata | Runtime error: Class extends value undefined is not a constructor or null #138

Closed LatentDream closed 3 months ago

LatentDream commented 3 months ago

Hi, I'm having a hard time make the library work on a react project.

When importing the following

import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
import { fetchDigitalAsset } from "@metaplex-foundation/mpl-token-metadata";

And using:

const umi = createUmi('http://127.0.0.1:8899').use(mplTokenMetadata())

I have the following runtime error:

ERROR
Class extends value undefined is not a constructor or null
TypeError: Class extends value undefined is not a constructor or null
    at ./node_modules/@metaplex-foundation/mpl-token-metadata/dist/src/errors.js (http://localhost:3000/static/js/bundle.js:136753:40)
    at options.factory (http://localhost:3000/static/js/bundle.js:545798:31)
    at __webpack_require__ (http://localhost:3000/static/js/bundle.js:545197:32)
    at fn (http://localhost:3000/static/js/bundle.js:545456:21)
    at ./node_modules/@metaplex-foundation/mpl-token-metadata/dist/src/hooked/metadataDelegateRoleSeed.js (http://localhost:3000/static/js/bundle.js:155582:18)
    at options.factory (http://localhost:3000/static/js/bundle.js:545798:31)
    at __webpack_require__ (http://localhost:3000/static/js/bundle.js:545197:32)
    at fn (http://localhost:3000/static/js/bundle.js:545456:21)
    at ./node_modules/@metaplex-foundation/mpl-token-metadata/dist/src/hooked/index.js (http://localhost:3000/static/js/bundle.js:155562:14)
    at options.factory (http://localhost:3000/static/js/bundle.js:545798:31)

A important point:


Version used:
"@metaplex-foundation/mpl-token-metadata": "^3.2.1",
"@metaplex-foundation/umi": "^0.9.2",
"@metaplex-foundation/umi-bundle-defaults": "^0.9.2",

with Webpack 5.5.0

Thanks for the help :)
LatentDream commented 3 months ago

Build problem, how to fix it is the same as this issue: https://stackoverflow.com/questions/78228700/how-to-fix-the-error-class-extends-value-undefined-is-not-a-constructor-or-null