Repository navigation
Description
Which @angular/* package(s) are the source of the bug?
service-worker
Is this a regression?
No
Description
We are currently trying to get rid of an old service worker using the safety-worker.js. While writing the corresponding scripts for replacing the ngsw-worker.js with the safety-worker.js I noticed that the contents of the files are the same.
I checked the source of https://github.com/angular/angular/tree/15.1.x/packages/service-worker to see if this change might be intentional and the safety-worker.js mentioned there is a small file containing few lines of code.
Out of curiosity i checked the safety-worker.js of angular io - same as the ngsw-worker.js!
https://angular.io/safety-worker.js
https://angular.io/ngsw-worker.js
This seems like an issue. If this is the expected behaviour, the documentation does not mention it.
Please provide a link to a minimal reproduction of the bug
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 15.1.4
Node: 16.15.1
Package Manager: npm 8.11.0
OS: linux x64
Angular: 15.1.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
... service-worker
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1501.4
@angular-devkit/build-angular 15.1.4
@angular-devkit/core 15.1.4
@angular-devkit/schematics 15.1.4
@angular/cli 15.1.4
@schematics/angular 15.1.4
rxjs 7.5.7
typescript 4.9.5
Anything else?
Can I use the safety-worker.js from the service-worker repository as a workaround for now?
Activity
alxhub commentedon Feb 8, 2023
Hi @000panther,
I'm going to transfer this to the CLI repo - as far as I can tell, this seems to be a problem with the CLI service worker build process. The
@angular/service-workerpackage itself is shipping the correct contents forsafety-worker.js: https://unpkg.com/browse/@angular/[email protected]/safety-worker.js000panther commentedon Feb 9, 2023
Thanks! I am now serving the file you mentioned as safety-worker.js, and it works perfectly! Would be awesome to get this fixed and have correct funtionality out of the box again.
fix(@angular-devkit/build-angular): correctly copy `safety-worker.js`…
fix(@angular-devkit/build-angular): correctly copy `safety-worker.js`…
fix(@angular-devkit/build-angular): correctly copy `safety-worker.js`…
fix(@angular-devkit/build-angular): correctly copy `safety-worker.js`…
angular-automatic-lock-bot commentedon Mar 13, 2023
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.