Using Web3.js in VueJS - Error: undefined is not a constructor or null

Viewed 367

I'm using VueJs + Webpack and trying to get Web.js to work.

I installed web.js using npm npm install web3 --save and I'm trying to use it in one of my VueJS components by importing it using import Web3 from 'web3'.

When I load my application I get an error:

app.js:101191 Uncaught TypeError: Class extends value undefined is not a constructor or null
    at module.exports (app.js:101191)
    at module.exports (app.js:101155)
    at Object../node_modules/keccak/js.js (app.js:101140)
    at __webpack_require__ (app.js:200063)
...

My package.json looks like:

    "private": true,
    "scripts": {
        ...
    },
    "devDependencies": {
        ...
    },
    "dependencies": {
        ...
        "web3": "^1.3.6"
    }

Do I need to import it using webpack? I'm new to this stack and would appreciate some help!

0 Answers
Related