node-libs-browser icon indicating copy to clipboard operation
node-libs-browser copied to clipboard

Dependency `assert` broken; webpack 2.

Open bdjnk opened this issue 7 years ago • 2 comments

I encountered Error Uncaught TypeError: util.inherits is not a function while upgrading to webpack 2.

I traced the cause to the dependency "inherits": "2.0.1" instead of "^2.0.1" or the like in util, which is used by assert, which is used by node-libs-browser.


My current hideous workaround is adding to package.json:

"dependencies": {
  "inherits": "^2.0.3"

and to webpack.config.js:

resolve: {
  alias: {
    inherits$: path.resolve(__dirname, 'node_modules/inherits')

I also filed a bug with util at Outdated dependency inherits causes trouble upstream; Webpack 2.

bdjnk avatar May 03 '17 17:05 bdjnk

The root issue here is https://github.com/browserify/commonjs-assert/issues/38.

jfirebaugh avatar Apr 17 '19 18:04 jfirebaugh

assert module has been update in updated version of node-libs-browser, so you can try that!

niksy avatar Nov 13 '21 17:11 niksy