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

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. #470

Open
imRHB opened this issue Apr 2, 2023 · 5 comments

Comments

@imRHB
Copy link

imRHB commented Apr 2, 2023

Hello!
I was trying to implement PWA in my portfolio. I got the error when I deployed to Vercel. I like to mention that the PWA is working fine in the localhost

Here is my Chrome dev console. Also, I'm getting the Uncaught (in promise) TypeError: Failed to fetch this error.

Screenshot 2023-04-02 205806

I'm using Next JS (version: ^13.1.1) and next-pwa (version: ^5.6.0)

Here is my next.config.js file

const runtimeCaching = require("next-pwa/cache");

const withPWA = require("next-pwa")({
    dest: "public",
    register: true,
    dynamicStartUrl: false,
    skipWaiting: true,
    runtimeCaching,
    buildExcludes: [
        /middleware-manifest\.json$/,
        /_middleware\.js$/,
        /_middleware\.js\.map$/,
        /middleware-runtime\.js$/,
        /middleware-runtime\.js\.map$/,
    ],
});

const nextConfig = withPWA({
    // next config
    reactStrictMode: true,
    images: {
        remotePatterns: [
            {
                protocol: "https",
                hostname: "i.ibb.co",
                pathname: "/**",
            },
        ],
    },
});

module.exports = nextConfig;

Can anyone help me to get rid of this problem?

@ImBIOS
Copy link

ImBIOS commented May 2, 2023

@imRHB It seems this repo is dead and the maintainer cannot be contacted for so long now. I've made an immediate response by resurrecting this repo ImBIOS/next-pwa.

@nitinTJ
Copy link

nitinTJ commented May 15, 2023

I am facing the same issue but I am using next js 13 app directory. Which, I think is not compatible with next-pwa currently.

@Haseebshah936
Copy link

I am facing the same issue as well

@nitinTJ
Copy link

nitinTJ commented May 16, 2023

It's working with the pages directory setup but not with app directory.

@Haseebshah936
Copy link

I am using a fork of the main repository https://github.com/DuCanhGH/next-pwa this has fixed the registration issue. I am testing it for fallback which I think is not working correctly.

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

4 participants