Skip to content

fix: use non-inline source maps when only sourceMap is true in tsconfig#1024

Merged
Brooooooklyn merged 1 commit intoswc-project:masterfrom
leon19:bugfix/fix-sourcemap-inline-option
Mar 31, 2026
Merged

fix: use non-inline source maps when only sourceMap is true in tsconfig#1024
Brooooooklyn merged 1 commit intoswc-project:masterfrom
leon19:bugfix/fix-sourcemap-inline-option

Conversation

@leon19
Copy link
Copy Markdown
Contributor

@leon19 leon19 commented Mar 30, 2026

When tsconfig has sourceMap: true without inlineSourceMap, the sourcemap option was incorrectly set to 'inline' due to operator precedence in the ternary expression. This caused broken line numbers in stack traces (off by the number of type-only lines stripped by SWC).

The fix ensures inline source maps are only produced when explicitly requested via inlineSourceMap: true in tsconfig or the SWC_NODE_INLINE_SOURCE_MAP environment variable.

Closes #848
Closes #861

When tsconfig has sourceMap: true without inlineSourceMap, the
sourcemap option was incorrectly set to 'inline' due to operator
precedence in the ternary expression. This caused broken line numbers
in stack traces (off by the number of type-only lines stripped by SWC).

The fix ensures inline source maps are only produced when explicitly
requested via inlineSourceMap: true in tsconfig or the
SWC_NODE_INLINE_SOURCE_MAP environment variable.

Closes swc-project#848
Closes swc-project#861
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 30, 2026

CLA assistant check
All committers have signed the CLA.

@Brooooooklyn Brooooooklyn merged commit f2345b9 into swc-project:master Mar 31, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect stack traces with inline sourceMaps Source maps broken since versions 1.10.1 (up to and including latest 1.10.9)

3 participants