-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Cannot find module 'virtual:pwa-register' or its corresponding type declarations. #277
Comments
I notice that with Vitesse the tsconfig.json does not have an explicit |
I created a reference file but it was still not working . Then I defined this reference file in tsconfig.json. It worked. global.d.ts tsconfig.json
|
For the integration with Astro this worked for me: {
"compilerOptions": {
"types": [
"vite-plugin-pwa/info.d.ts",
"vite-plugin-pwa/client.d.ts"
]
}
}
|
@rogi29 you have also |
That's even better, thanks! |
For anyone new: Vite generates a file called |
Hey, AUnlike the above using it only worked for me when adding them to
Bor as per @mustafadalga adding them to :
with now build is working again 👌 |
None of these are working for me in Svelte 4. |
@mahyarmirrashed what virtual pwa module are you using? if you're using |
Following the instructions here: https://vite-plugin-pwa.netlify.app/guide/auto-update.html#runtime
Repro: start fresh Vite Vue TypeScript app, install the Vite PWA plugin, and use the following vite.config.ts and main.ts
vite.config.ts
main.ts
I read similar issues like #40 and #227 and came up with the following "fix"...
Update tsconfig.json include node_modules/vite-plugin-pwa/client.d.ts:
Trying to build now complains about workbox-window missing, so then install workbox-window:
After that build succeeds and I can see the service worker is registered in the Application tab of Chrome dev tools.
But it would be nice if things worked out of the box as per the instructions :)
The text was updated successfully, but these errors were encountered: