Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

239
Views
Failed to register a ServiceWorker (Next.js)

i have created a sample next project i use this command : npx create-next-app i install next-pwa after that i configure next.config,create manifest.json and _document.js in project directory

this is my next.config.js :

const withPWA = require("next-pwa");

module.exports = withPWA({
reactStrictMode:true,
pwa: {
dest: "public",
register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === 'development'
}

});

my _document.js :

import Document, { Html, Head, Main, NextScript } from "next/document";

class MyDocument extends Document {
render() {
    return (
        <Html>
            <Head>
                <link rel="manifest" href="/manifest.json" />
                <link rel="apple-touch-icon" href="/icon.png"></link>
                <meta name="theme-color" content="#fff" />
            </Head>
            <body>
            <Main />
            <NextScript />
            </body>
        </Html>
    );
}
}

export default MyDocument;

after run : npm run build and npm start i saw this error : enter image description here

Anyone have a solution?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Looks like a bug. Please, downgrade next-pwa version to 5.5.4 and it should work.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!