Closed Will-Mann-16 closed 2 years ago
Ahhhhh found the b*gger, turns out my _document getInitialProps
was wrong.
It wasn't anything at all
export class Document extends NextDocument {
... more stuff
We need to add this
export class Document extends NextDocument {
static async getInitialProps(ctx) {
return await NextDocument.getInitialProps(ctx);
}
Nope, didn't work on prod / build - but does work in localhost version - even with the fix above.
Think I may wait a day as service workers take up to 24 hours to replace themselves unless anyone can spot a glaring problem.
Hey @Will-Mann-16, did you manage to solve the issue? 😄
Yes actually, upgrading my next js version and next-pwa version seemed to do the trick. Hope this helps.
Summary
I'm getting this error when using lighthouse to check the PWA to see if it's working correctly.
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.
Versions
next-pwa
: 5.4.0next
: 12.1.5How To Reproduce
Use lighthouse tool to inspect PWA aspect of page.
Expected Behaviors
The PWA to be acknowledged by Lighthouse, and have an 'Install Button' - not sure if this is a browser or config thing, mainly I would like the PWA to work as intended.
Screenshots
next.config.js
pages/_document.tsx
public/manifest.json
Dockerfile
Additional Context
I'm using Kubernetes, Docker and to that extend
expermentalFeatures.standalone: true
Also usingnext-sitemap
don't know if that conflicts.If anyone would like to look at the website hosted in it's current form: https://www.ls6.events