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 danielleadams committed Feb 1, 2022
1 parent 2c7f17c commit 9eb8233
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/api/errors.md
Original file line number Diff line number Diff line change
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 9eb8233

Please sign in to comment.