dev-server: es2016 prebundle target for zone.js apps lowers private fields and breaks dependencies
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- angular, babel, node.js, typescript
- 領域
- build-system
調査の方向性
Start by tracing the dev-server dependency prebundle configuration changed in #33772 and how its es2016 target is applied to zone.js apps; the issue does not name the relevant files or tests. Compare the existing Babel linker step and Rolldown target behavior, then run the provided ix-modal reproduction with zone.js. Done when prebundling lowers async/await without lowering unrelated syntax such as private fields, and the modal can be cancelled without the ReferenceError.
索引モデルが issue の本文から書いたものです。
説明
Command
serve
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
22.0.1
Description
Since #33772 (22.1.4), the dev server prebundles dependencies with an es2016 target for zone.js apps, so async/await gets lowered (#33770). But rolldown can't lower only async/await like esbuild's supported: { 'async-await': false } did. With es2016, it lowers everything newer, including private fields.
That hits an oxc bug: when a static private field is lowered, the helper references the class by name, and if the method has a local with the same name, it reads the local in its TDZ. Minified libraries hit this easily, because the minifier reuses t for both. In our case iX modals can't be closed anymore in ng serve. Production is fine, since it doesn't prebundle and esbuild only lowers async/await.
The oxc bug itself: https://github.com/oxc-project/oxc/issues/27376
I know the actual bug is in oxc, but every zone.js app now runs all its dependencies through a much bigger transform in dev than in production, which is how we ran into it. It'd be great if the prebundle could only lower async/await again. One idea: the prebundle already runs Angular's Babel step for the linker, so @babel/plugin-transform-async-to-generator could do it there and rolldown could keep the real browser targets. I didn't test that though.
Minimal Reproduction
https://github.com/felix-eschey/ix-modal
git clone https://github.com/felix-eschey/ix-modal && cd ix-modal
npm ci
npm run broken # ng serve on http://localhost:4300 with zone.js
Open http://localhost:4300, click "Open modal" and then Cancel. The modal stays open and the console shows the ReferenceError. npm run working is the same app without zone.js and works. npm run excluded keeps zone.js but excludes iX from prebundle and works too.
Exception or Error
ReferenceError: Cannot access 't' before initialization
at t$8.ensureCache (p-BqeSHO6C.js:1:304)
at get mediumTime (p-BqeSHO6C.js:1:1189)
Your Environment
Angular CLI : 22.1.7
Angular : 22.1.6
Node.js : 24.18.0
Package Manager : npm 11.16.0
Operating System : linux x64
@angular/build : 22.1.7
zone.js : 0.15.1
Anything else relevant?
Workaround is prebundle: { exclude: [...] } for the affected packages. iX issue: https://github.com/siemens/ix/issues/2874
- 主要言語
- TypeScript
- スター
- 27k
- フォーク
- 11.8k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 161
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
angular/angular-cli のほかの issue
-
area: @angular/build gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
angular/angular-cli#33955 ·
メンテナーはふだん 1 日以内に返信
-
area: @angular/cli gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
angular/angular-cli#33055 · コメント 1 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
SSR resolves relative `redirectTo` against the wrong base when the route path has several segments対応中かも @bschaeublin が今日担当しました。 オープンarea: @angular/ssr
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
angular/angular-cli#34300 ·
メンテナーはふだん 1 日以内に返信
-
SSR route redirects drop the query string on relative `redirectTo`対応中かも @bschaeublin が今日担当しました。 オープンarea: @angular/ssr
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
angular/angular-cli#34298 ·
メンテナーはふだん 1 日以内に返信
-
area: @angular/build
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
angular/angular-cli#34292 ·
メンテナーはふだん 1 日以内に返信
angular/angular-cli の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
supadata-ai/mcp#27 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
capricorn86/happy-dom#2485 ·
メンテナーはふだん 2 日以内に返信
-
优化导入 OCR 模型选择文件的按钮样式オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
siyuan-note/siyuan#20430 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Albert-Weasker/niubigeo#194 ·
メンテナーはふだん 1 日以内に返信