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

publicURL issue when using SPA in Firebase. #6

Closed
supertopoz opened this issue Apr 18, 2018 · 2 comments
Closed

publicURL issue when using SPA in Firebase. #6

supertopoz opened this issue Apr 18, 2018 · 2 comments

Comments

@supertopoz
Copy link
Contributor

supertopoz commented Apr 18, 2018

Currently the navigatorFallback for the workbox looks like this:

workbox.generateSW(
				Object.assign({
					globDirectory: outDir,
					globPatterns: ['**\/*.{html,js,css,jpg,png}'],
					swDest: swDest,
					navigateFallback: publicURL + "/index.html",
					clientsClaim: true,
					skipWaiting: true,
					"templatedUrls": {
						"/": ["index.html"]
					}

This can cause an issue with when the publicURL is equal to "/". The issue is that the generated service worker output sets the the workbox.routing.registerNavigatorRoute to look like this:

workbox.routing.registerNavigationRoute("//index.html");

As a result I have to change the code for the navigateFallback to be like this.

navigateFallback: publicURL + "index.html",

If I don't do this deployment to Firebase fails when the front end routes are reloaded. ideally the registerNavigationRoute should look like this when the service worker is created.

workbox.routing.registerNavigationRoute("/index.html");
@mischnic
Copy link
Owner

Thank you!

Fixed by #7

@mischnic
Copy link
Owner

Fixed in v0.2.3

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