Esbuild Web Worker Type Safety and Redundant tsconfig.worker.json
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- angular, typescript
- Domain
- build-system, cli
Research direction
Start by reproducing the described Angular CLI esbuild workflow: generate a web worker, add a type error, and run ng build. Inspect the generated tsconfig.worker.json and the builder schema's webWorkerTsConfig option. Done means worker type-checking behavior is corrected or clearly documented, with misleading configuration addressed.
Written by the indexing model from the issue text.
Description
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
No response
Description
When using esbuild as the bundler for Angular projects, the support for web workers appears misleading in terms of type safety:
-
In the previous webpack-based build setup, web workers had proper TypeScript type checking at build time.
-
Currently, esbuild does not type-check web workers during build time. This is not documented or clearly communicated, leading to a false sense of correctness.
-
Additionally, creating a project with a web worker generates a
tsconfig.worker.json, which seems redundant because esbuild doesn't use it for type-checking. Alsobuildercontains thewebWorkerTsConfigoption in the schema, as I understand it, this doesn't affect anything. This can confuse developers into thinking their web worker code is properly validated.
Expected Behavior
Either esbuild-based builder should perform type checking on web worker files, or there should be clear documentation and/or warnings that type-checking is not performed on workers.
Current Behavior
-
No build-time type checking for worker code.
-
Misleading tsconfig.worker.json is generated, giving false confidence in type safety.
Minimal Reproduction
- Generate a new Angular project with esbuild (Angular CLI 18+).
- Add a web worker via ng generate web-worker.
- Introduce a type error in the worker file.
- Run ng build – no type error is reported.
Exception or Error
Your Environment
Any version with esbuild bundler.
Anything else relevant?
No response
- Dominant language
- TypeScript
- Stars
- 27k
- Forks
- 11.8k
- Avg merge
- 16h 35m
- Merged PRs (30d)
- 176
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from angular/angular-cli
-
area: @angular/build gemini-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
angular/angular-cli#33055 · 1 comment · 3 reactions ·
-
area: @angular/build gemini-triaged
Difficulty 4/5 3-5 days Newbie friendliness 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 assignee ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 assignee ·
All issues in angular/angular-cli
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vicharanashala/fln#563 ·