dapp-core icon indicating copy to clipboard operation
dapp-core copied to clipboard

Class extends value undefined is not a constructor or null

Open dragoscv opened this issue 2 years ago • 4 comments

When using import { DappUI, useGetLoginInfo } from '@elrondnetwork/dapp-core'; I get the following error in console:

Uncaught TypeError: Class extends value undefined is not a constructor or null
    at module.exports (keccak.js:5:1)
    at module.exports (index.js:6:1)
    at ./node_modules/keccak/js.js (js.js:1:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at ./node_modules/@elrondnetwork/erdjs/out/signableMessage.js (signableMessage.js:12:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)

I can't manage to find a solution, all that I'm doing is importing the library

Edit: In a TypeScript project it works, but in a simple JS react-app doesn't work

dragoscv avatar Jun 10 '22 19:06 dragoscv

This error usually indicates a circular dependency. Can you check if you have any dependencies in your app?

StanislavSava avatar Jun 15 '22 07:06 StanislavSava

@dragoscv any progress on this?

StanislavSava avatar Jun 27 '22 07:06 StanislavSava

@dragoscv any progress on this?

Just use their template. Or start a create-react-app with TypeScript. It doesn't work if your project is built in plain JavaScript. I've built my app using their template and migrated my other template into this

dragoscv avatar Jun 27 '22 08:06 dragoscv

I'm not sure I understand. Whos template? Why doesn't it work? You mean importing dapp-core into an app using plain js, no Typescript?

StanislavSava avatar Jul 13 '22 09:07 StanislavSava

It was fixed some time ago. Please use the latest version

CiprianDraghici avatar Dec 19 '22 22:12 CiprianDraghici