Skip to content

Project won't compile after adding webworker to Angular 11 #19884

@ezforw

Description

@ezforw

🐞 bug report

Affected Package

The issue is caused by package @angular-devkit/build-angular/src/babel/webpack-loader.js

Is this a regression?

Yes, the previous version in which this bug was not present was: v10

Description

Added web worker to an existing Angular 11 project, then the project won't compile anymore.

The error was gone when "webWorkerTsConfig": "tsconfig.worker.json" was removed from angular.json

🔬 Minimal Reproduction

  1. Checkout https://github.com/ezforw/angular-11-webworker-sample
  2. npm install
  3. npm start

🔥 Exception or Error


Error: ./node_modules/@auth0/auth0-spa-js/dist/auth0-spa-js.production.esm.js
Module parse failed: Cannot read property 'length' of undefined
File was processed with these loaders:
 * ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js
 * ./node_modules/@ngtools/webpack/src/ivy/index.js

🌍 Your Environment

Angular Version:


Angular CLI: 11.1.0
Node: 12.6.0
OS: darwin x64

Angular: 11.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1101.0
@angular-devkit/build-angular   0.1101.0
@angular-devkit/core            11.1.0
@angular-devkit/schematics      11.1.0
@schematics/angular             11.1.0
@schematics/update              0.1101.0
rxjs                            6.6.3
typescript                      4.1.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions