[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 issueHey 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:
- Created 2 years ago
- Reactions:1
- Comments:11 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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 yourmain.ts
:You can see the
examples/vue-*
directories on this repo. Instead using vanilla version of the virtual module, they’re using the vue 3 variantimport { useRegisterSW } from 'virtual:pwa-register/vue'
onReloadPrompt.vue
component, that’s included onApp.vue
.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!