Repository navigation
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilStencil v5This is slated for Stencil v5 (Release date TBD)
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
4.45.2
Current Behavior
- the source map sources paths are pointing to non existing files (missing ../../)
- the dist files contain multiple source map references where the first one could be non existing
Expected Behavior
- source map soruces point the the actual source file
- the dist files only have one source map references which points to the correct source map
System Info
System: node 24.15.0
Platform: linux (7.0.0-38-generic)
CPU Model: 13th Gen Intel(R) Core(TM) i7-13700H (20 cpus)
Compiler: /home/stephan/projects/stencil-core-source-maps-issues/node_modules/@stencil/core/compiler/stencil.js
Build: 1791199168
Stencil: 4.45.2 🐘
TypeScript: 5.8.3
Rollup: 4.44.0
Parse5: 7.2.1
jQuery: 4.0.0-pre
Terser: 5.37.0Steps to Reproduce
Install all dependencies and execute stencil build
1. source map references
Open any dist file for example: dist/esm/test-component.entry.js
The source map references will be doubled.
//# sourceMappingURL=button.error-hint.icon-alert-circle.icon-eye.icon-eye-off.input.spinner.entry.cjs.js.map<-- non existent//# sourceMappingURL=button_7.entry.js.map<-- correct one
2. source map sources
Open any dist map file for example: dist/esm/test-component.entry.js.map
The map.sources property will start with a relative path, for example: src/components, if resolved from the current map file the file will not be found. The correct path is ../../src/components.
Code Reproduction URL
Additional Information
related issue:
Metadata
Metadata
Assignees
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilStencil v5This is slated for Stencil v5 (Release date TBD)
Activity
mrcrumpy commentedon Oct 28, 2026
We see the same on 4.45.2 (Node 24,
sourceMap: true, outputsdistanddist-custom-elements).Sources path: the bundle maps of both output targets have
sourcesrelative to the package root (src/...) and nosourceRoot. Resolved from the map file, that points into the output directory, where the files don't exist, so devtools and coverage tools can't find the originals. Thedist/collectionmaps are correct (../../../../src/...).In our case this also breaks coverage when testing the built output with
@stencil/vitest: istanbul remaps through the maps, can't place the sources undersrc/, and the components show 0%.Duplicate
sourceMappingURL: also present here, in most bundle files. For us, both comments point to the same, existing map, so it's harmless, unlike the non-existent first reference in the original report.