Skip to content

Error message property contains call stack information in Node 12 #27388

Closed
@AlexKamaev

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    moduleIssues and PRs related to the module subsystem.questionIssues that look for answers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions