util.inspect on Node.js 5.x.x Causing Issues
See original GitHub issueI have a project that we use this module in. Upon making a request to createContainerIfNotExists, the project continues to execute as if the call happened but it does not. The module will eventually get to this line and stop:
self.logger.log(Logger.LogLevels.DEBUG, 'FINAL REQUEST OPTIONS:\n' + util.inspect(finalRequestOptions));
Calling util.inspect lands up eventually getting to this following block of code within node’s util.js:
function ensureDebugIsInitialized() {
if (Debug === undefined) {
const runInDebugContext = require('vm').runInDebugContext;
Debug = runInDebugContext('Debug');
}
}
The last line, Debug = runInDebugContext(‘Debug’); lands up never returning and the promise that called it never returns/ends. This completely causes all debugging for the app that makes use of your module to stop working.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Better support for Error.cause in util.inspect / console.log #40859
Is your feature request related to a problem? Please describe. Given this code: const one = new Error('one'); const two = new Error('two', ......
Read more >Util | Node.js v19.3.0 Documentation
A string representation of an object with generic JavaScript object formatting. Similar to util.inspect() with options { showHidden: true, showProxy: true } ....
Read more >What is util.inspect() in Node.js? - Educative.io
Nodejs provides a utility function for debugging called util.inspect() . util.inspect() returns a string representation of the object passed as a parameter ...
Read more >How to Debug Node.js Code Using Multiple Tools - Kinsta
This tutorial demonstrates various tools to debug node applications and find their root causes. Dig in and learn from the ground up.
Read more >How to Debug a Node.js Application: Tips, Tricks and Tools
js application will fail. If you're lucky, your code will crash with an obvious error message. If you're unlucky, your application will carry...
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
@tSreeram Thanks for sharing. @atom0s I am going to close the issue. Please feel free to reopen it if the latest Nodejs doesn’t work for you. Thanks.
I also faced similar util.inspect issue. But after upgrade to NodeJS 5.6 (latest) the debugger issue is resolved.