Skip to content

[Vitest]: Incorrect stacktrace in reporter #30823

@DmitryMakhnev

Description

@DmitryMakhnev

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

Incorrect filepath in error's stacktrace in custom reporter:

Image

It users filepath from compiled sources and filename from real sources. By default Vitest uses link to sources for TypeScript too.

Might be it was produced by specific fixes for Angular's reporter, because the reporter uses sources filenames:
Image

Minimal Reproduction

https://github.com/DmitryMakhnev/ng20-vitest-stacktrace-in-reporter

Exception or Error


Your Environment

Angular CLI: 20.0.1
Node: 22.15.0
Package Manager: npm 10.9.2
OS: darwin arm64

Angular: 20.0.2
... common, compiler, compiler-cli, core, forms
... platform-browser, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2000.1
@angular-devkit/core         20.0.1
@angular-devkit/schematics   20.0.1
@angular/build               20.0.1
@angular/cli                 20.0.1
@schematics/angular          20.0.1
rxjs                         7.8.2
typescript                   5.8.3

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions