Skip to content

Update to 1.3.0-rc.5 broke my service worker (with --build-optimizer) #7280

Closed
@mrjmd

Description

@mrjmd

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

image

Repro steps.

git clone git@github.com:contentacms/contenta_angular.git
cd contenta_angular
npm install
ng serve --prod --build-optimizer
Examine the dist/sw-register bundle.

The log given by the failure.

No error, just no service worker being registered any more. Inside my sw-register I see the problem, this is the entire contents:

webpackJsonp([3],{3:function(n,o,t){n.exports=t("EUKP")},EUKP:function(n,o){navigator}},[3]);

When normally it looks like this:

webpackJsonp([3],{3:function(r,e,o){r.exports=o("EUKP")},EUKP:function(r,e){"serviceWorker"in navigator&&navigator.serviceWorker.register("worker-basic.min.js").catch(function(r){console.error("Error registering service worker:",r)})}},[3]);

Mention any other details that might be useful.

I was previously running 1.3.0-rc.0 so I'm not sure which version introduced this issue, I tested 1.3.0-rc.3 as well and my dist/sw-register file looks as expected, so my guess is this was just introduced. Note the size of the sw-register bundle here using rc.3:

image

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfuleffort1: easy (hours)type: bug/fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions