Error `Uncaught TypeError: util.inherits is not a function`
See original GitHub issueI want to use console.log
in my script, so I added node: { console: true }
to my configuration. Now when I try to load the script, it reports Uncaught TypeError: util.inherits is not a function
. The error is occuring in the Webpack version of assert.js
at the line:
util.inherits(assert.AssertionError, Error);
I nosed around a bit, and it seems that that file is being parsed twice (if I put a log statement at the top of the file, it is written to the console twice). The first time, the util
object is correct and has an inherits
property that is a function. The second time, util
is still an object but it has no properties.
Does anyone have an idea what might be going on here? If not, I will try to put together a simple reproducible use case.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Uncaught TypeError: util.inherits is not a function
I recently ran into an issue when I tried to import a reference to jsonwebtoken into a new Vue 3 project configured with...
Read more >Webpack-dev-server 2 Uncaught TypeError: util.inherits is not ...
I have a problem trying when i run webpack-dev-server not console error in ... Uncaught TypeError: util.inherits is not a function.
Read more >util.inherits - npm
util -inherits will try use Object.setPrototypeOf , if Object.setPrototypeOf is not supported, then Object.create , or manipulate prototype.
Read more >Node.js util.inherits() Method - GeeksforGeeks
The “util” module provides 'utility' functions that are used for ... Its (i.e, util.inherits()) usage is not much encouraged instead use of ...
Read more >Util | Node.js v19.3.0 Documentation
If the section name appears within the value of that environment variable, then the returned function operates similar to console.error() . If not,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is seriously annoying :hurtrealbad:. I did this in the end, because the
node-util
probably won’t ever get updated again:Then in your config, monkeypatch
node-libs-browser
:Adding this to the webpack config solved it for me.