Skip to content

prebundle import ordering issue #32607

@HazzMan2409

Description

@HazzMan2409

Command

build

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

19 or 20

Description

In your application, if you do the following:

import "./my-zone-flags";
import "zone.js";

zone.js runs before my-zone-flags.

This only occurs when prebundling is on.

Minimal Reproduction

https://github.com/HazzMan2409/prebundle-order-issue

Exception or Error


Your Environment

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

Angular CLI       : 21.2.0
Angular           : 21.2.0
Node.js           : 22.17.1
Package Manager   : npm 10.9.2
Operating System  : darwin arm64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build            │ 21.2.0            │ ^21.2.0           │
│ @angular/cli              │ 21.2.0            │ ^21.2.0           │
│ @angular/common           │ 21.2.0            │ ^21.2.0           │
│ @angular/compiler         │ 21.2.0            │ ^21.2.0           │
│ @angular/compiler-cli     │ 21.2.0            │ ^21.2.0           │
│ @angular/core             │ 21.2.0            │ ^21.2.0           │
│ @angular/forms            │ 21.2.0            │ ^21.2.0           │
│ @angular/platform-browser │ 21.2.0            │ ^21.2.0           │
│ @angular/router           │ 21.2.0            │ ^21.2.0           │
│ rxjs                      │ 7.8.2             │ ~7.8.0            │
│ typescript                │ 5.9.3             │ ~5.9.2            │
│ vitest                    │ 4.0.18            │ ^4.0.8            │
│ zone.js                   │ 0.16.1            │ ^0.16.1           │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: repro stepsWe cannot reproduce the issue with the information given

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions