Skip to content

bug: source maps issues #6959

Open

Description

@stephan-dum

Prerequisites

Stencil Version

4.45.2

Current Behavior

  1. the source map sources paths are pointing to non existing files (missing ../../)
  2. the dist files contain multiple source map references where the first one could be non existing

Expected Behavior

  1. source map soruces point the the actual source file
  2. 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.0

Steps 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.

  1. //# sourceMappingURL=button.error-hint.icon-alert-circle.icon-eye.icon-eye-off.input.spinner.entry.cjs.js.map <-- non existent
  2. //# 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

https://github.com/stephan-dum/stencil-core-source-maps-issues

Additional Information

related issue:

Activity

  1. mrcrumpy commented on Oct 28, 2026

    @mrcrumpy

    We see the same on 4.45.2 (Node 24, sourceMap: true, outputs dist and dist-custom-elements).

    Sources path: the bundle maps of both output targets have sources relative to the package root (src/...) and no sourceRoot. 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. The dist/collection maps 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 under src/, 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.

  2. added
    Bug: Validated
    and removed on Nov 11, 2026
  3. added theissue type on Nov 11, 2026
  4. added
    Stencil v5
    on Nov 11, 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

    Bug: ValidatedStencil v5

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions