Skip to content

Karma esbuild builder stack trace sourcemap reference dist/test-out #29766

@cexbrayat

Description

@cexbrayat

Command

test

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When using the @angular/build:karma builder, a test in error will show the following sourcemap:

at dist/test-out/29ed73c2-b781-409d-a89d-bfa4055a0227/src/app/app.component.spec.ts:20:23

instead of referencing src/app.component.spec.ts:17:34 which allows to click it and open it directly in the IDE.

Minimal Reproduction

Run:

npx @angular/cli@20.0.0-next.0 new karma-sourcemap --defaults --no-routing

Edit app.component.spec.ts to make a test fail and run ng test:

Chrome 133.0.0.0 (Mac OS 10.15.7) AppComponent should have the 'karma-sourcemap' title FAILED
        Expected 'karma-sourcemap' to equal 'other'.
            at <Jasmine>
            at UserContext.<anonymous> (dist/test-out/29ed73c2-b781-409d-a89d-bfa4055a0227/src/app/app.component.spec.ts:20:23)

Exception or Error


Your Environment

Angular CLI: 20.0.0-next.0
Node: 20.18.3
Package Manager: npm 10.9.0
OS: darwin arm64

Angular: 20.0.0-next.1
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2000.0-next.0
@angular-devkit/core         20.0.0-next.0
@angular-devkit/schematics   20.0.0-next.0
@angular/build               20.0.0-next.0
@angular/cli                 20.0.0-next.0
@schematics/angular          20.0.0-next.0
rxjs                         7.8.2
typescript                   5.8.2
zone.js                      0.15.0

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions