`ng generate web-worker` adds `webWorkerTsConfig` to the `@angular/build:unit-test` target, breaking `ng test`
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #34386 @MeAkib による — マージ済み
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- angular, typescript
- 領域
- testing
調査の方向性
Read packages/schematics/angular/web-worker/index.ts and inspect the logic that adds webWorkerTsConfig to the test target. Compare the supported test builders with the unit-test builder’s options, then check the schematic spec mentioned in the issue’s proposed fix. Done means generating a web worker leaves ng test --watch=false passing for a new application.
索引モデルが issue の本文から書いたものです。
説明
Command
generate
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
Running ng generate web-worker in a newly created application breaks ng test.
The web-worker schematic adds webWorkerTsConfig to the options of the project's test target, regardless of
which builder that target uses. New applications use the @angular/build:unit-test builder, whose schema does not
have a webWorkerTsConfig option, so ng test fails schema validation afterwards.
The option is still needed on the build target (where the schematic also adds it). Removing it from the test
target makes ng test pass again, including with the worker in place.
Relevant code: packages/schematics/angular/web-worker/index.ts
if (testTarget) {
(testTarget.options ??= {}).webWorkerTsConfig ??= workerConfigPath;
}
Minimal Reproduction
ng new ww-repro --defaultscd ww-reprong test --watch=false→ passesng generate web-worker appng test --watch=false→ fails with the error below
After step 4, the test target in angular.json is:
"test": {
"builder": "@angular/build:unit-test",
"options": {
"webWorkerTsConfig": "tsconfig.worker.json"
}
}
Deleting webWorkerTsConfig from the test target options makes ng test pass again.
Exception or Error
Error: Schema validation failed with the following errors:
Unknown option "webWorkerTsConfig". Valid options are: buildTarget, tsConfig, runner, runnerConfig, browsers, browserViewport, include, exclude, filter, watch, headless, debug, ui, isolate, splitting, quiet, coverage, coverageInclude, coverageExclude, coverageReporters, coverageThresholds, coverageWatermarks, reporters, outputFile, providersFile, setupFiles, progress, listTests, dumpVirtualFiles.
Your Environment
Angular CLI : 22.2.3
Node.js : 24.15.0
Package Manager : npm 11.12.1
OS : darwin arm64
@angular/build : 22.2.3
vitest : 5.0.5
Anything else relevant?
Suggested fix: only add webWorkerTsConfig to the test target when it uses a Karma builder
(@angular-devkit/build-angular:karma / @angular/build:karma). The unit-test builder gets build options from
its buildTarget. Happy to send a PR with a spec.
- 主要言語
- TypeScript
- スター
- 27k
- フォーク
- 11.8k
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 241
環境構築
- 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 日以内に返信
-
area: @angular/build
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
angular/angular-cli#34524 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
`ng generate app-shell` and `ng generate module --route` produce broken imports when a component `type` is configured対応中かも @MeAkib が 6 日前に担当しました。 オープンarea: @schematics/angular
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
angular/angular-cli#34449 ·
メンテナーはふだん 1 日以内に返信
-
Tailwind CSS v4 classes in new or moved files are not picked up by ng serve until another rebuild対応中かも @MeAkib が 7 日前に担当しました。 オープンarea: @angular/build
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
angular/angular-cli#34446 ·
メンテナーはふだん 1 日以内に返信
angular/angular-cli の issue をすべて見る
似ている issue
-
Plugin: sheet music can't be scrolled by hand before playback対応中かも @snakajima が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
receptron/jinglescript#51 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 9 日以内に返信
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openclaw/openclaw#186424 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
chore(worker): five module header comments describe the code from before later issues changed itオープンarea:dev U2-later
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
bentleypark/aiwatch#1824 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Pal-AI-Lab/Coopanion#469 ·
メンテナーはふだん 1 日以内に返信