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

Error registering service worker in new version #14

Closed
Cryodev1 opened this issue Dec 8, 2022 · 2 comments
Closed

Error registering service worker in new version #14

Cryodev1 opened this issue Dec 8, 2022 · 2 comments

Comments

@Cryodev1
Copy link

Cryodev1 commented Dec 8, 2022

Expected Behavior

Should be registering service worker to be used

Current Behavior

Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('http://localhost:8080//service/') with script ('http://localhost:8080/sw.js'): A bad HTTP response code (404) was received when fetching the script.

Steps to Reproduce

  1. Install latest
  2. npm install in directory
  3. npm start
  4. Open website
  5. Search anything

Possible Cause

I used an old version of uv on this computer so its possible some things aren't matching up because of things left by the old version

@Cryodev1
Copy link
Author

Cryodev1 commented Dec 8, 2022

Update: Installing Ultraviolet-Static worked but now the error has changed to

SecurityError: Failed to register a ServiceWorker for scope ('http://localhost:8080/service/') with script ('http://localhost:8080/uv/sw.js'): The path of the provided scope ('/service/') is not under the max scope allowed ('/uv/'). Adjust the scope, move the Service Worker script, or use the Service-Worker-Allowed HTTP header to allow the scope.

Along with

uv.sw.js:30 Uncaught TypeError: Class extends value undefined is not a constructor or null
at uv.sw.js:30:43
at uv.sw.js:1:4641
at sw.js:10:1

@e9x
Copy link
Contributor

e9x commented Dec 8, 2022

SecurityError: Failed to register a ServiceWorker for scope ('http://localhost:8080/service/') with script ('http://localhost:8080/uv/sw.js'): The path of the provided scope ('/service/') is not under the max scope allowed ('/uv/'). Adjust the scope, move the Service Worker script, or use the Service-Worker-Allowed HTTP header to allow the scope.

You will either need to move the UV scripts to the root of your static directory, or configure your config to run on /uv/service/.

uv.sw.js:30 Uncaught TypeError: Class extends value undefined is not a constructor or null at uv.sw.js:30:43 at uv.sw.js:1:4641 at sw.js:10:1

This is due to cache or you have not updated your uv.bundle.js.

@e9x e9x closed this as completed Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants