`ng generate web-worker` adds `webWorkerTsConfig` to the `@angular/build:unit-test` target, breaking `ng test`
Mantenedores costumam responder em até 1 dia
Um pull request relacionado já foi integrado.
- #34386 de @MeAkib — integrado
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- angular, typescript
- Domínio
- testing
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 27k
- Forks
- 11.8k
- Merge médio
- 1d 6h
- PRs com merge (30d)
- 224
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de angular/angular-cli
-
area: @angular/build gemini-triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
angular/angular-cli#33955 ·
Mantenedores costumam responder em até 1 dia
-
area: @angular/cli gemini-triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
angular/angular-cli#33055 · 1 comentário · 3 reações ·
Mantenedores costumam responder em até 1 dia
-
Angular SSR Unescaped prerender parameters enable RCE through generated manifests and XSS in redirect pagesTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaarea: @angular/ssr
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 53/100
angular/angular-cli#34474 ·
Mantenedores costumam responder em até 1 dia
-
`ng generate app-shell` and `ng generate module --route` produce broken imports when a component `type` is configuredTalvez já em andamento @MeAkib assumiu há 2 dias. Abertaarea: @schematics/angular
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
angular/angular-cli#34449 ·
Mantenedores costumam responder em até 1 dia
-
Tailwind CSS v4 classes in new or moved files are not picked up by ng serve until another rebuildTalvez já em andamento @MeAkib assumiu há 2 dias. Abertaarea: @angular/build
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
angular/angular-cli#34446 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de angular/angular-cli
Issues semelhantes
-
数据界面的横向滚动条缺失Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
zilliztech/attu#1037 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
openclaw/openclaw#181212 · 1 comentário · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
apify/apify-mcp-server#1684 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Automattic/data-liberation-agent#953 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
siteboon/claudecodeui#1642 ·
Mantenedores costumam responder em até 5 dias