Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular 8 webpack-bundle-analyzer looking for wrong polyfill files

No matter what I do, after building my project I keep getting the following error:

Error parsing bundle asset "<path-to-project>\polyfills-es5-es2015.e1bdcd70857e70f37509.js": no such file
events.js:174

Which is exactly right seeing that my project creates a polyfills-es5.e1bdcd70857e70f37509 file and a polyfills-es2015.25bfed26497f24d6d1d7 file.

This is in a nx workspace project that I created yesterday

After every build the file names obviously changes, but it keeps looking for a mixed es5-es2015 polyfills file.

The stats file gets created as stats-es2015.json and our package.json settings is: "bundle-report": "webpack-bundle-analyzer dist/apps/<project-name>/stats-es2015.json"

I keep getting the error with default build or production, with ivy enabled or disabled, and I eve tried to remove the es5BrowserSupport flag, hoping there will only be one polyfills file, but it is still looking for es5-es2015 file...

like image 395
Alfa Bravo Avatar asked Oct 15 '22 09:10

Alfa Bravo


1 Answers

Try this command to see if it work for you

ng build --prod --stats-json && webpack-bundle-analyzer dist/stats.json

My tsconfig.json

    "module": "esNext",
    "target": "es5",
like image 80
Tony Ngo Avatar answered Oct 19 '22 02:10

Tony Ngo