vite icon indicating copy to clipboard operation
vite copied to clipboard

vue and vuex dependencies not installed

Open sternelee opened this issue 4 years ago • 5 comments

Versions

nuxt-vite: 0.0.29 nuxt: 2.15.2

Reproduction

just init nuxt and add nuxt-vite

The reproduction repo is here: https://github.com/sternelee/vite-nuxt

Description

 ERROR  Client compiled with errors: The following dependencies are imported but could not be resolved:

  vue (imported by D:/www/**project**/store/drive.js)
  unfetch (imported by D:/www/**project**/.nuxt/client.js)
  vuex (imported by D:/www/**project**/components/web/Qrcode.vue)
  vue-meta (imported by D:/www/**project**/.nuxt/index.js)
  vue-client-only (imported by D:/www/**project**/.nuxt/index.js)
  vue-no-ssr (imported by D:/www/**project**/.nuxt/index.js)
  vue-router (imported by D:/www/**project**/.nuxt/router.js)
  axios (imported by D:/www/**project**/api/get-pub-key.esm.js)

Are they installed?


  vue (imported by D:/www/**project**/store/drive.js)
  unfetch (imported by D:/www/**project**/.nuxt/client.js)
  vuex (imported by D:/www/**project**/components/web/Qrcode.vue)
  vue-meta (imported by D:/www/**project**/.nuxt/index.js)
  vue-client-only (imported by D:/www/x**project**/.nuxt/index.js)
  vue-no-ssr (imported by D:/www/**project**/.nuxt/index.js)
  vue-router (imported by D:/www/**project**/.nuxt/router.js)
  axios (imported by D:/www/**project**/api/get-pub-key.esm.js)

  Are they installed?
  at optimizeDeps (node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\chunks\dep-e0f09032.js:67754:15)
  at processTicksAndRejections (internal/process/task_queues.js:93:5)
  at runOptimize (node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\chunks\dep-e0f09032.js:68328:48)
  at Object.createServer (node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\chunks\dep-e0f09032.js:68356:9)
  at buildClient (node_modules\.pnpm\[email protected]\node_modules\nuxt-vite\dist\nuxt-vite.js-vite.js:63:22)
  at callBuild (node_modules\.pnpm\[email protected]\node_modules\nuxt-vite\dist\nuxt-vite.js-vite.js:383:7)
  at async Promise.all (index 0)
  at bundle (node_modules\.pnpm\[email protected]\node_modules\nuxt-vite\dist\nuxt-vite.js-vite.js:391:5)
  at Builder.build (node_modules\.pnpm\@nuxt\[email protected]\node_modules\@nuxt\builder\dist\builder.js:327:5)

sternelee avatar Mar 10 '21 06:03 sternelee

@sternelee Could you provide a reproduction?

danielroe avatar Mar 10 '21 06:03 danielroe

E.g: I use Vue.set in store.js, so

import Vue from 'vue'

sternelee avatar Mar 10 '21 06:03 sternelee

I mean a sample project on GitHub that can reproduce the issue.

danielroe avatar Mar 10 '21 08:03 danielroe

I mean a sample project on GitHub that can reproduce the issue.

just init nuxt and add nuxt-vite

The reproduction repo is here: https://github.com/sternelee/vite-nuxt

sternelee avatar Mar 10 '21 10:03 sternelee

Hi @sternelee thanks for repro. It seems you are pnp which is not tested and supported for nuxt/vite. I have escalated this to #91 for supporting pnpm and plug-and-play

pi0 avatar Mar 10 '21 10:03 pi0