What this thread does
Do first: set sourceMap: true, inlineSources: false and inlineSourceMap: false, then decide which artifacts are private server files and which are publicly served.
Short answer
As of November 2026, use the current TypeScript configuration docs with Node.js 26.13.1 LTS. Keep matching maps readable by Node and excluded from public static delivery.
Choose / don't choose
- External maps: choose for separate public JS and private diagnostics; don't remove the server's matching maps when Node must translate stacks (TypeScript).
- Inline maps: choose when deliberately shipping the map inside JS; don't choose when maps must be withheld from JS recipients (inlineSourceMap).
- Source-mapped stack traces: choose when Node should translate stack locations; don't replace its formatter without delegating to it (Node CLI).
Not for: Sentry artifact upload and release matching; see sentry-stack-traces-still-minified-source-maps-release-checklist.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
sourceMap | true: emit adjacent .js.map and a sourceMappingURL reference | Current TypeScript docs | sourceMap |
inlineSources | false: do not embed original TS in sourcesContent; enabling requires either map option | Current TypeScript docs | inlineSources |
inlineSourceMap | Embeds source map content; mutually exclusive with sourceMap | Current TypeScript docs | inlineSourceMap |
--enable-source-maps | Makes a best effort to report stack traces relative to the original source file | Current Node docs | CLI |
Error.prepareStackTrace | Call and return the original Error.prepareStackTrace results | Current Node docs | CLI |
Order of operations
1. Compile JS and maps together. Inspect the final map for absent sourcesContent; any downstream bundler can independently embed sources. 2. Install the exact matching maps before starting Node. Preserve relative map references beside private server JS. This packaging order follows Node's module-load-time map detection; enabling support after modules load can miss their maps (module API). 3. Deploy only the intended public artifacts to the static server/CDN. Exclude maps and TS source files from public delivery; map metadata can still reveal file names. A JS map comment is a pointer, not access control. 4. Start node --enable-source-maps dist/server.js. In the reader's deployment, trigger a controlled error and inspect the original TS location, then check that public artifact routes do not deliver maps or source text.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
| Stack remains at generated JS | A custom formatter may prevent Node's mapping | Save the original Error.prepareStackTrace, call it and return its result | CLI |
CPU Utilisation bumps | Reported CPU or memory bumps in larger applications | Measure error-path overhead and avoid repeated stack formatting on hot paths | saurabhdaware report |
The independent report documents a historical production overhead case, not a latency prediction for this build.
Missing
- The linked source does not confirm: External maps translate locations without requiring embedded source text; Disabling embedded sources alone does not make a publicly accessible map private (release page does not discuss map privacy).
- Public access control depends on the deployment; TypeScript compiler flags cannot enforce it.
- Exact compiler release is not pinned here; these are current docs, November 2026.
Checked
2026-11-12; Node release, CLI/module docs, TypeScript source-map option pages and saurabhdaware's dated report read. No build or deployment commands executed.
Started from a post by @Microsoft, packaged by the editor. Original post