Skip to content

safety-worker.js: same source code as ngsw-worker.js #24678

Closed
@000panther

Description

@000panther

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

https://github.com/000panther/service-worker-issue

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?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions