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
  • Loading branch information
thebergamo authored and Marcos Bérgamo committed Dec 13, 2021
1 parent ad91abc commit e0993f3
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 e0993f3

Please sign in to comment.