Skip to content

Code splitting change introduced in @angular/build@22.1.5 breaks vitest cobertura report #33938

Closed as not planned

Description

@dezsiszabi

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

@angular/build@22.1.4

Description

Please see the README in the reproduction repo: https://github.com/dezsiszabi/cobertura-bug-repro-2

I also opened this issue in the vitest repository because first I thought it's caused by vitest: vitest-dev/vitest#11069

In short:

The new @angular/build@22.1.5 or later produces a slightly different (invalid IMHO) cobertura coverage report XML which breaks the Jenkins CI plugin that tries to parse it.

The report shouldn't contain duplicate method names for the same class, but with @angular/build@22.1.5 and later, multiple entries like (anonymous_0) are generated.

Minimal Reproduction

Please see: https://github.com/dezsiszabi/cobertura-bug-repro-2

Exception or Error

cobertura report file contains method multiple entries with the same name.

Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI       : 22.1.6
Angular           : 22.1.4
Node.js           : 24.19.0
Package Manager   : npm 11.17.0
Operating System  : linux x64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build            │ 22.1.6            │ ^22.1.6           │
│ @angular/cli              │ 22.1.6            │ ^22.1.6           │
│ @angular/common           │ 22.1.4            │ ^22.1.4           │
│ @angular/compiler         │ 22.1.4            │ ^22.1.4           │
│ @angular/compiler-cli     │ 22.1.4            │ ^22.1.4           │
│ @angular/core             │ 22.1.4            │ ^22.1.4           │
│ @angular/forms            │ 22.1.4            │ ^22.1.4           │
│ @angular/platform-browser │ 22.1.4            │ ^22.1.4           │
│ @angular/router           │ 22.1.4            │ ^22.1.4           │
│ rxjs                      │ 7.8.2             │ ~7.8.0            │
│ typescript                │ 6.0.3             │ ~6.0.2            │
│ vitest                    │ 4.1.11            │ 4.1.11            │
│ zone.js                   │ 0.16.2            │ ~0.16.2           │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else relevant?

No response

Activity

  1. added
    gemini-triaged
    on Aug 27, 2026
  2. added this to the needsTriage milestone on Aug 27, 2026
  3. clydin commented on Aug 27, 2026

    @clydin
    Member

    This appears to be an issue within @vitest/coverage-v8 related to its V8 byte offset remapping logic. Have you tried using @vitest/coverage-istanbul instead?

  4. added 6 commits that reference this issue on Aug 27, 2026
    8bce16a
    cfaa501
    2c03d17
    f0f034f
    3dd7aa1
    c3cefba
  5. dezsiszabi commented on Aug 27, 2026

    @dezsiszabi
    Author

    This appears to be an issue within @vitest/coverage-v8 related to its V8 byte offset remapping logic. Have you tried using @vitest/coverage-istanbul instead?

    It does with with @vitest/coverage-istanbul. See my comment on the vitest issue: vitest-dev/vitest#11069 (comment)

  6. removed
    needs: more info
    on Aug 27, 2026
  7. added a commit that references this issue on Aug 27, 2026
    78d8f1c
  8. alan-agius4 commented on Aug 27, 2026

    @alan-agius4
    Collaborator

    Closing as you mention this is a bug in vitest.

  9. angular-automatic-lock-bot commented on Oct 20, 2026

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  10. locked and limited conversation to collaborators on Oct 20, 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

    area: @angular/buildgemini-triagedseverity5: regression

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions