Skip to content

[Replacement]: source-map-support #1027

Open

Description

@gameroman

Package to replace

source-map-support and @cspotcode/source-map-support

Suggested replacement(s)

node --enable-source-maps index.js
NODE_OPTIONS="--enable-source-maps" node index.js
import { findSourceMap } from 'node:module'

const sourceMap = findSourceMap('/path/to/file.js')
import { setSourceMapsSupport } from 'node:module'

setSourceMapsSupport(true, { nodeModules: true, generatedCode: true })

Manifest type

native (replaceable by a built-in platform feature)

Rationale

Node.js has it natively now

Availability

Since Node.js v23.7.0, v22.14.0

Activity

  1. dreyfus92 commented on Aug 27, 2026

    @dreyfus92
    Member

    can you add the programmatic apis to the suggested replacements? most usage is require('source-map-support').install() / import 'source-map-support/register' from inside the program, and the native equivalent of that is:

    process.setSourceMapsEnabled(true)
    import { setSourceMapsSupport } from 'node:module'
    setSourceMapsSupport(true, { nodeModules: true, generatedCode: true })

    findSourceMap is a different thing (returns the parsed map, doesn't touch stack traces), fine to list but it shouldn't sit next to the flag as if it did the same job

    gaps worth a line in the entry:

    • native skips node_modules by default since 22.14. source-map-support never did. library authors shipping compiled code need nodeModules: true or their consumers' traces won't be mapped
    • environment: 'browser' has no native equivalent, this is node only retrieveSourceMap / retrieveFile hooks have no native equivalent

    for @cspotcode/source-map-support the entry should say it ships with ts-node and goes away when ts-node does, rather than suggest swapping it manually.

  2. gameroman commented on Aug 27, 2026

    @gameroman
    ContributorAuthor

    Updated issue description 👍

  3. added
    acceptedUsed to signal if a suggested replacement has been accepted.
    on Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedUsed to signal if a suggested replacement has been accepted.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions