vite-pwa / vite-plugin-pwa

Zero-config PWA for Vite
https://vite-pwa-org.netlify.app/
MIT License
3.21k stars 210 forks source link

TS2307: Cannot find module 'vite-plugin-pwa' or its corresponding type declarations. #456

Closed anburocky3 closed 1 year ago

anburocky3 commented 1 year ago

I'm using Laravel + InertiaJS with typescript.

As per the documentation, i did the following.

  1. Installed using yarn add vite-plugin-pwa -D
  2. Edited the vite.config.ts file and added the following code>
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
  plugins: [
    VitePWA({
      registerType: 'autoUpdate',
      devOptions: {
        enabled: true
      }
    })
  ]
})
  1. Added the types in my tsconfig.json

    {
    "compilerOptions": {
        "types": [
            "vite/client",
            "node",
            "unplugin-icons/types/vue",
            "vite-plugin-pwa/client",
            "googlemaps"
        ],
    }
    }
  2. But still have this error in my PhpStorm IDE.

image

anburocky3 commented 1 year ago

I restarted my system and now the error is gone. Thank you.