BRUH! NG BUILD DOES NOT GENERATE SERVICE WORKER!
See original GitHub issueBug Report
Affected Package
The issue is caused by package @angular/....Is this a regression?
No, because every other build before 12, ng build was not supposed to use the --prod flag.
Description
OH EMM GEEE GUYS. After reading the new Angular 12 blog post, I was under the assumption that we no longer needed to use the --prod flag. --prod is supposedly gonna be deprecated right. But then yesterday right before my demo, ngsw-worker.js could not be found. Kept getting a 404. I spent a entire day debugging this, and it turns out, just simply using the --prod flag builds the damned service worker.
In short, someone need to put the damned service worker in the ng build plox or revise the directions so that we go back to the --prod flag.
Minimal Reproduction
This one real simple reproduce yo, just ng build with a project that’s ng added @angular/pwa and such, then ng build, you will not see the ngsw-worker stuff. THEN hit ng build --prod, and it will work as it used to.
Exception or Error
Cannot GET /ngsw-worker.js
Your Environment
Angular Version:
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 12.0.1
Node: 14.16.1
Package Manager: npm 7.12.0
OS: darwin x64
Angular: 12.0.1
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, platform-browser, platform-browser-dynamic
... router, service-worker
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1200.1
@angular-devkit/build-angular 12.0.1
@angular-devkit/core 12.0.1
@angular-devkit/schematics 12.0.1
@angular/fire 6.1.0-rc.2
@schematics/angular 12.0.1
rxjs 6.6.7
typescript 4.2.4
Anything else relevant? It’s pretty hard to just start debugging on without your Chrome Devtools stuff. So just be aware of that.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Thanks @eneajaho. We do not automatically migrate projects that upgrade from a previous version to use production by default. Closing as this is working as planned.
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.