Skip to content

Commit

Permalink
doc: include stack trace difference in ES modules
Browse files Browse the repository at this point in the history
This change highlights in the docs difference between stack traces for
CommonJS modules and ES Modules.

Fixes: #39787

PR-URL: #41157
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
thebergamo authored and targos committed Jan 14, 2022
1 parent 5ed8a1c commit e819685
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/api/errors.md
Expand Up @@ -344,7 +344,10 @@ The location information will be one of:
* `plain-filename.js:line:column`, if the frame represents a call internal
to Node.js.
* `/absolute/path/to/file.js:line:column`, if the frame represents a call in
a user program, or its dependencies.
a user program (using CommonJS module system), or its dependencies.
* `<transport-protocol>:///url/to/module/file.mjs:line:column`, if the frame
represents a call in a user program (using ES module system), or
its dependencies.

The string representing the stack trace is lazily generated when the
`error.stack` property is **accessed**.
Expand Down

0 comments on commit e819685

Please sign in to comment.