Hello
Starting from Node version 12 the Cannot find module error contains stack information inside of a message property.
However, in the 10 version the error message didn't contain the stack information in the message property.
Will this inconsistency be fixed?
You can easily reproduce it by the following code:
聽
try {
require('non-existing-module')
}
catch (err) {
console.log(err.message);
}
My console output:
Cannot find module 'non-existing-module'
Require stack:
- D:\Projects\testcafe\non-existing-module.js
聽
Node version 12
Windows 64
This is an intentional semver-major change. See https://github.com/nodejs/node/pull/25690
Is there any issue around this? It should improve debugging overall.
There is no issue. Thank you for your information and for pointing out to the PR
Most helpful comment
This is an intentional semver-major change. See https://github.com/nodejs/node/pull/25690
Is there any issue around this? It should improve debugging overall.