nuxt icon indicating copy to clipboard operation
nuxt copied to clipboard

Cannot find module '#pwa' or its corresponding type declarations.

Open brugomes opened this issue 11 months ago • 2 comments

I'm following the basic instructions to setup @vite-pwa/nuxt

pnpm add @vite-pwa/nuxt -D

// nuxt.config.ts
import { defineNuxtConfig } from 'nuxt/config'

export default defineNuxtConfig({
  modules: [
    '@vite-pwa/nuxt'
  ],
  pwa: {
    /* PWA options */
  }
})

And got this error.

image image

I also have tryed this and got the same error.

rm -Rf node_modules
rm -Rf dist
rm -Rf .nuxt
pnpm store prune
pnpm add @vite-pwa/nuxt -D --force  

brugomes avatar Mar 25 '24 02:03 brugomes

@brugomes did you happen to fix this? Also seeing this error...

snolan-ethika avatar Jun 06 '24 17:06 snolan-ethika

Error when adding the pwa module? Provide a minimal reproduction, all my tests can install the pwa module: check https://vite-pwa-org.netlify.app/guide/scaffolding.html , follow the prompts selecting Vue when asking for Framework then Nuxt.

Maybe you can try adding .npmrc file with shamefully-hoist=true (iirc only pnpm).

@snolan-ethika @brugomes

userquin avatar Jun 06 '24 22:06 userquin