Skip to content

Enable inlineSources to fix sourcemap missing source warnings#2352

Open
veeceey wants to merge 1 commit intofb55:masterfrom
veeceey:fix/issue-2309-sourcemap-sources
Open

Enable inlineSources to fix sourcemap missing source warnings#2352
veeceey wants to merge 1 commit intofb55:masterfrom
veeceey:fix/issue-2309-sourcemap-sources

Conversation

@veeceey
Copy link

@veeceey veeceey commented Feb 13, 2026

Fixes #2309

When using tools like Vitest, warnings like this are emitted:

Sourcemap for "node_modules/.pnpm/htmlparser2@10.1.0/node_modules/htmlparser2/lib/esm/index.js" points to missing source files

This happens because the .map files reference relative paths to .ts source files (e.g. ../../src/index.ts) that aren't always resolvable in node_modules — particularly with pnpm's symlinked structure.

Adding inlineSources: true to tsconfig.json embeds the TypeScript source content directly into the sourcesContent field of each .map file, so consumers no longer need to resolve those external paths.

Verified locally:

  • Before: .map files have no sourcesContent field
  • After: all .map files include sourcesContent with the full source text
  • All 103 tests pass, linting passes

Tools like Vitest emit warnings about sourcemap files pointing to
missing sources because the .map files reference relative paths to
.ts files that aren't resolvable in node_modules contexts (especially
with pnpm). Adding inlineSources embeds the source content directly
into the .map files, eliminating the need to resolve external paths.

Fixes fb55#2309
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sourcemap references missing source files

1 participant