Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox 69+: Error unregistering serviceWorker #8047

Closed
Smarello opened this issue Nov 29, 2019 · 19 comments
Closed

Firefox 69+: Error unregistering serviceWorker #8047

Smarello opened this issue Nov 29, 2019 · 19 comments

Comments

@Smarello
Copy link

When trying to run an application created with creat-react-app using Firefox 69+ I receive the following error:

Unhandled Rejection (SecurityError): The operation is insecure

Error unregistering serviceWorker

Tested with latest Chrome and Edge version -> OK
Tested with Firefox 67 -> OK

@gamedev8
Copy link

gamedev8 commented Dec 5, 2019

#8079 fixes this issue

If it's urgent for you then you'll have to apply the change directly in your project. Here is the fix.
https://github.com/facebook/create-react-app/pull/8079/files

@esetnik
Copy link

esetnik commented Dec 5, 2019

@gamedev8 I don't think this issue is related to #8079. I am experiencing #8047 in production, not when running with webpack dev server.

@gamedev8
Copy link

gamedev8 commented Dec 5, 2019

@esetnik are you sure? I was also getting this "SecurityError The operation is insecure" error and the code in #8079 fixed it for me.

@esetnik
Copy link

esetnik commented Dec 5, 2019

@gamedev8 you were getting the SecurityError The operation is insecure in production or when you run the project locally? I'm getting that security error when the project is in production which has nothing to do with the change in #8079.

@gamedev8
Copy link

gamedev8 commented Dec 5, 2019

@esetnik Ok there must be different issues happening. I was getting it locally in Firefox using https.

@dstroot
Copy link

dstroot commented Dec 7, 2019

Same issue here. Latest Chrome and Safari are fine. Only latest Firefox complains. Development only:

Screen Shot 2019-12-07 at 1 45 33 PM

@stale
Copy link

stale bot commented Jan 7, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Jan 7, 2020
@Smarello
Copy link
Author

Smarello commented Jan 7, 2020

The issue is still present, please don't close it.

@stale stale bot removed the stale label Jan 7, 2020
@imcgeoch
Copy link

imcgeoch commented Jan 8, 2020

I experience the same issue. Only in Firefox, using http, in my dev environment. Registering the service worker makes the problem go away, but this is not a desirable solution.

@guyjacks
Copy link

I'm also experiencing this issue in Firefox 72.0.2 (64-bit) on Mac OS Mojave 10.14.6.

@lPadier
Copy link

lPadier commented Jan 23, 2020

This exception is raised in Firefox when the Delete cookies and site data when Firefox is closed (in settings) is set.

'serviceWorker' in navigator is true but the navigator.serviceWorker.ready Promise rejects (at least on Firefox 72)

@ottosson
Copy link

What's the reasoning for having service workers in the CRA template? I guess it's a good thing if you want offline support and what not, but is it really necessary as a default?

@dstroot
Copy link

dstroot commented Jan 26, 2020

This exception is raised in Firefox when the Delete cookies and site data when Firefox is closed (in settings) is set.

'serviceWorker' in navigator is true but the navigator.serviceWorker.ready Promise rejects (at least on Firefox 72)

@lPadier - BOOM! That is it. I have Firefox setup the same way and was scratching my head!

@steverecio
Copy link

I'm also seeing this on production with Firefox 73.0

@esetnik
Copy link

esetnik commented Feb 27, 2020

I believe this was fixed in #8272 but you need to manually update your serviceWorker.js file to match the template for an existing project.

@steverecio
Copy link

FWIW I'm seeing better handling in the latest version of serviceWorker.js. I'm going to try swapping mine out with the new code and see if that works.

@steverecio
Copy link

I believe this was fixed in #8272 but you need to manually update your serviceWorker.js file to match the template for an existing project.

Ha yup I think that's probably it.

@esetnik
Copy link

esetnik commented Feb 27, 2020

I think the default serviceWorker.js should be referenced from the react-scripts project instead of being part of the template with the capability to override the default. There's been a number of changes to the serviceWorker over time and it's a pain to have to manually keep it in sync.

@ianschmitz
Copy link
Contributor

Closing as it sounds like it's resolved in latest templates.

@lock lock bot locked and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants