Skip to content

Cannot make it instalable with Github pages #28

@waghcwb

Description

@waghcwb

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions