From 9eb8233bf637166ccd5824f7e2ea92a29f213e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20B=C3=A9rgamo?= Date: Mon, 13 Dec 2021 12:01:40 +0100 Subject: [PATCH] doc: include stack trace difference in ES modules This change highlights in the docs difference between stack traces for CommonJS modules and ES Modules. Fixes: https://github.com/nodejs/node/issues/39787 PR-URL: https://github.com/nodejs/node/pull/41157 Reviewed-By: James M Snell --- doc/api/errors.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index b2e6ad86f84f84..35c5203e5916de 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -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. +* `:///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**.