Closed rustygreen closed 3 years ago
For new projects this is fixed via https://github.com/angular/angular-cli/pull/21057.
For existing projects, in angular.json
you need to specify the web-worker tsconfig path in using the webWorkerTsConfig
option under the test builder.
That did it. Thanks, @alan-agius4!
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
🐞 Bug Report
Affected Package
The issue involves the generator for service workers when using Angular 12.
Is this a regression?
The issue was not present in previous versions of Angular. It only started happening for Angular 12.
Description
When adding a web worker in Angular12 (now required to use the
import.meta.url
due to webpack 5 - as the Angular docs describe), unit tests will not run:Minimal Reproduction
npx -p @angular/cli ng new worker-test --style=scss --routing
cd new worker-test
npm run ng -- generate web-worker my-test-worker
Add web worker usage in app.component.ts
npm run test
Exception or Error
Your Environment
Angular Version: