Skip to content

Error.prepareStackTrace not called when --enable-source-maps #29994

Closed
@dougwilson

Description

@dougwilson
  • Version: v12.12.0
  • Platform: Windows 10 64-bit
  • Subsystem: error

It seems that when --enable-source-maps is enabled, the way errors work is altered. For example, a global Error.prepareStackTrace function is no longer called as part of the process.

I know --enable-source-maps is experimental based on the docs, but cannot find any specific information on, for example, if this is an expected change to runtime behavior or not.

Just glancing around at the source code, I believe that internal/errors.js is what is calling the Error.prepareStackTrace when defined, but the command line flag replaces the stack trace implementation to one that does not call Error.prepareStackTrace any longer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.errorsIssues and PRs related to JavaScript errors originated in Node.js core.source mapsIssues and PRs related to source map support.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions