question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Resolved] 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.

See original GitHub issue

Hey there i am facing this issue - 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. My plugin is setup correctly

  • my vite.config.ts file -
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { VitePWA } from "vite-plugin-pwa";

// https://vitejs.dev/config/
export default defineConfig({
 plugins: [
   react(),
   VitePWA({
     includeAssets: [
       "favicon.svg",
       "favicon.ico",
       "robots.txt",
       "apple-touch-icon.png",
     ],
     registerType: "autoUpdate",
     manifest: {
       name: "IMG To PDF",
       short_name: "iTp",
       icons: [
         {
           src: "/android-chrome-192x192.png",
           sizes: "192x192",
           type: "image/png",
         },
         {
           src: "/android-chrome-512x512.png",
           sizes: "512x512",
           type: "image/png",
         },
         {
           src: "/android-chrome-512x512.png",
           sizes: "512x512",
           type: "image/png",
           purpose: "any maskable",
         },
       ],
       theme_color: "#2a2e38",
       background_color: "#2a2e38",
       display: "standalone",
       start_url: "/",
       lang: "en-US",
       orientation: "portrait-primary",
     },
   }),
 ],
}); 

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
userquincommented, Nov 16, 2021

@Whirl21 @vijayRT you need to import the virtual module and call it to register the service worker: https://vite-plugin-pwa.netlify.app/frameworks/#usage

@vijayRT since you’re using autoUpdate strategy just add this to your main.ts:

import { registerSW } from 'virtual:pwa-register'
...
registerSW({ immediate: true })

You can see the examples/vue-* directories on this repo. Instead using vanilla version of the virtual module, they’re using the vue 3 variant import { useRegisterSW } from 'virtual:pwa-register/vue' on ReloadPrompt.vue component, that’s included on App.vue.

1reaction
Whirl21commented, Nov 17, 2021

To Anyone Having the same issue - you might not have followed the steps in guide page 3 & 4 like me and just thought you don’t need those, while you actually do!

Read more comments on GitHub >

github_iconTop Results From Across the Web

No matching service worker detected. You may need to reload ...
You may need to reload the page, or check that the scope of the service worker for the current page encloses the scope...
Read more >
Site cannot be installed: no matching service worker detected
Place the service worker script file at the root of your website and set start_url to / , or place it wherever you...
Read more >
How do I add a service worker to an existing app? : r/reactjs
No matching service worker detected. You may need to reload the page, or check that the scope of the service worker for the...
Read more >
[2022] No matching service worker detected. You may need to ...
No matching service worker detected. You may need to reload the page, or check that the scope of the service worker for the...
Read more >
No matching service worker detected in PWA - IntegerByte Blog
You may need to reload the page or check that the service worker for the current page also controls the start of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found