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

fix: register service worker with a relative path #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arnaudvalle
Copy link
Collaborator

If the app is run in a sub folder (like it is now with github pages), then it was pointing to a service worker in the root folder of the domain rather than the current folder of the app (i.e. /grejbox/)

Fixing error message when launching the app:

Uncaught (in promise) TypeError: ServiceWorker script at https://mcastagnetti.github.io/sw.js for scope https://mcastagnetti.github.io/ encountered an error during installation.

Test:

  • Launch the app
  • There should be no error message

If the app is run in a sub folder (like it is now with github pages), then it was pointing to a service worker in the root folder of the domain rather than the current folder of the app (i.e. /grejbox/)
@arnaudvalle arnaudvalle added the bug Something isn't working label Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant