kevinmarrec / nuxt-pwa-module

⚠️ DEPRECATED ⚠️ Zero config PWA solution for Nuxt 3
MIT License
339 stars 32 forks source link

ERROR Cannot restart nuxt: The requested module '@nuxt/kit' does not provide an export named 'addImportsDir' #88

Closed devloperabhishek closed 1 year ago

devloperabhishek commented 1 year ago

Getting below error:

ERROR Error while requiring module @kevinmarrec/nuxt-pwa: SyntaxError: The requested module '@nuxt/kit' does not provide an export named 'addImportsDir'

ERROR Cannot restart nuxt: The requested module '@nuxt/kit' does not provide an export named 'addImportsDir' 16:25:12

import { useNuxt, addTemplate, addServerHandler, defineNuxtModule, createResolver, addImportsDir } from '@nuxt/kit'; ^^^^^^^^^^^^^ SyntaxError: The requested module '@nuxt/kit' does not provide an export named 'addImportsDir' at ModuleJob._instantiate (internal/modules/esm/module_job.js:124:21) at async ModuleJob.run (internal/modules/esm/module_job.js:179:5) at async Loader.import (internal/modules/esm/loader.js:178:24) at async normalizeModule (node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:432:28) at async installModule (node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:415:41) at async initNuxt (node_modules/nuxt/dist/index.mjs:1825:7) at async load (node_modules/nuxi/dist/chunks/dev.mjs:6779:9) at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6840:5) at async _main (node_modules/nuxi/dist/cli.mjs:50:20)

Screenshot 2023-01-19 at 4 36 25 PM

after following steps:

  1. npm install -D @kevinmarrec/nuxt-pwa
  2. Edit my nuxt.config.ts file to add PWA module : modules: [ '@kevinmarrec/nuxt-pwa' ]
amery commented 1 year ago

I have similar problems witth a different nuxt plugin. somehow Vue loses its TransitionProps declaration. I think it's caused by over-aggressive tree shaking but I have no idea how to deal with it

manniL commented 1 year ago

@amery this sounds like a totally different problem

@devloperabhishek Please share a reproduction on e.g. stackblitz and ensure you use Nuxt 3.0.0

kevinmarrec commented 1 year ago

@devloperabhishek Please follow @manniL comment regarding Nuxt version & sharing a reproduction.

kevinmarrec commented 1 year ago

It was most probably an issue regarding other @nuxt/kit installed version over nuxt framework @nuxt/kit one.

Evertyhing should work if you're simply using latest Nuxt (at least ^3.0.0).

Closing as stale issue.