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

SW/Cache not loading due to wrong paths #67

Closed
hoptimized opened this issue Aug 2, 2022 · 0 comments · Fixed by #68
Closed

SW/Cache not loading due to wrong paths #67

hoptimized opened this issue Aug 2, 2022 · 0 comments · Fixed by #68

Comments

@hoptimized
Copy link
Contributor

If the template is hosted under a path, e.g. https://emilk.github.io/**eframe_template/**, the following elements will show 404 errors:

  • manifest.json
  • sw.js
  • icon_ios_touch_192.png

As a result, the service worker fails to load, and the PWA loses its offline/caching capabilities.

Console output for https://emilk.github.io/eframe_template/:

Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('https://emilk.github.io/') with script ('https://emilk.github.io/sw.js'): A bad HTTP response code (404) was received when fetching the script.
hoptimized added a commit to hoptimized/eframe_template that referenced this issue Aug 2, 2022
Closes emilk#67

Remove the top-level path (`/`) from all source links in index.html so that
the template takes relative paths can work when hosted under a path,
e.g. `https://emilk.github.io/eframe_template/`
@emilk emilk closed this as completed in #68 Aug 2, 2022
emilk pushed a commit that referenced this issue Aug 2, 2022
Closes #67

Remove the top-level path (`/`) from all source links in index.html so that
the template takes relative paths can work when hosted under a path,
e.g. `https://emilk.github.io/eframe_template/`
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

Successfully merging a pull request may close this issue.

1 participant