-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap custom inspect hook in try/catch within util.js #10587
Wrap custom inspect hook in try/catch within util.js #10587
Comments
@skbolton Sorry for the lack of follow-up from our side here. Do you remember which module this is about? If I understood the issue correctly, the best way to address this would be to add an I am not sure a catch-all |
Should this remain open? |
Well I made a change in the library to no longer have an inspection method on it. But this is one of those things that authors wouldn't even realise is there |
This is documented and using |
I was diagnosing an issue where calls to
console.log(require.cache)
was giving me lots of problems. After debugging for a while I think I found the problem. The module had an inspect function on it and that was being called when the console.log was formatting the output. I found this code in utils.js starting at line 342Wouldn't it be a good idea to wrap the call to maybeCustomInspect in a try/catch so that if library authors don't realize this naming collision exists and an error is thrown that the native formatValue is used?
The text was updated successfully, but these errors were encountered: