WebAssembly in Angular 12 breaks ng serve (Webpack 5) #20762
Labels
area: @angular-devkit/build-angular
freq1: low
Only reported by a handful of users who observe it rarely
severity3: broken
type: bug/fix
Milestone
Bug Report
Affected Package
I'm guessing
@angular-devkit/build-angular
.Is this a regression?
Yes this is a regression: in Angular 11 with Webpack 4 there was no such error message and the project would just compile.
Description
When I run
ng serve
after upgrading to Angular 12, I get an error message from the CLI and the project won't compile. This is due to the upgrade to Webpack 5 and a change in their default configuration, which now explicitly requiresexperiments.asyncWebAssembly: true
to be added to the Webpack configuration. As Angular CLI users by default don't have access to the Webpack configuration the project for many users that use WebAssembly in their Angular project might break.Advanced users may fix this by using custom builders that allow changes to the Webpack configuration, but I don't think that's what we want for the Angular CLI.
Minimal Reproduction
Pull the repo, install the dependencies and run
ng serve
.https://github.com/Timebutt/repro-app
Exception or Error
Your Environment
Angular Version:
Workaround
For now, I can work around this issue by patching
node_modules
by adding the following snippet tonode_modules/@angular-devkit/build-angular/src/webpack/configs/common.js
(somewhere in the config object line 317 through the end).The text was updated successfully, but these errors were encountered: