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

Cannot make it instalable with Github pages #28

Open
waghcwb opened this issue Mar 12, 2022 · 0 comments
Open

Cannot make it instalable with Github pages #28

waghcwb opened this issue Mar 12, 2022 · 0 comments

Comments

@waghcwb
Copy link

waghcwb commented Mar 12, 2022

I'm trying to make a static pwa with next.js and tailwind.

Steps

  1. Use create-next-pwa:
npx create-next-pwa pwa-test --tailwind
  1. Install gh-pages dependency and update package.json
"scripts": {
	"dev": "next dev",
	"build": "next build && next export",
	"start": "next start",
	"format": "prettier --write \"./**/*.{js,json}\"",
	"predeploy": "npm run build",
	"deploy": "gh-pages -d out -t true"
},
  1. Update next.config.js
const withPWA = require('next-pwa');

module.exports = withPWA({
	basePath: '/temp',
	pwa: {
		dest: 'public',
		register: true,
		skipWaiting: true
	}
});
  1. Run deploy script (you need to setup the remote repo)
    npm run deploy

In development mode, the pwa is instalable and works fine.
But when I run next export and add the static site to Github pages, I always get this error:

No matching service worker detected. You may need to reload the page, or check that the scope of the service worker for the current page encloses the scope and start URL from the manifest.

image

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

1 participant