vuetifyjs / vue-cli-plugins

🔌 A collection of Vuetify plugins for Vue CLI
https://vuetifyjs.com/en/getting-started/quick-start#vue-cli-3
Other
428 stars 113 forks source link

Vuetify error on invoking generator #262

Closed MRmlik12 closed 3 years ago

MRmlik12 commented 3 years ago

Hi!

I have a problem with installing vuetify 3 on my migrated vue project from vue 2 to vue 3. I tried reinstall npm packages but not still working.

Error: You cannot call "get" on a collection with no paths. Instead, check the "length" property first to verify at least 1 path exists.
    at Collection.get (/usr/local/lib/node_modules/@vue/cli/node_modules/jscodeshift/src/Collection.js:213:13)
    at injectOptions (/usr/local/lib/node_modules/@vue/cli/lib/util/codemods/injectOptions.js:15:6)
    at runTransformation (/usr/local/lib/node_modules/@vue/cli/node_modules/vue-codemod/dist/src/runTransformation.js:60:17)
    at Object.keys.forEach.file (/usr/local/lib/node_modules/@vue/cli/lib/Generator.js:290:23)
    at Array.forEach (<anonymous>)
    at Generator.resolveFiles (/usr/local/lib/node_modules/@vue/cli/lib/Generator.js:276:24)
    at process._tickCallback (internal/process/next_tick.js:68:7)
jacekkarczmarczyk commented 3 years ago

How did you install Vuetify 3? The error looks like you're trying to install Vuetify 2 with Vue 3

MRmlik12 commented 3 years ago

I selected advanced mode but I choosed Preview (Vuetify3 + Vite) another error has been shown

Error: ENOENT: no such file or directory, stat '/home/mrmlik12/Projects/wulkanowy-web/frontend/node_modules/vue-cli-plugin-vuetify/generator/templates/v3/src/App.ts.vue'
    at Object.statSync (fs.js:855:3)
    at isBinaryFileSync (/usr/local/lib/node_modules/@vue/cli/node_modules/isbinaryfile/lib/index.js:50:25)
    at renderFile (/usr/local/lib/node_modules/@vue/cli/lib/GeneratorAPI.js:478:7)
    at _injectFileMiddleware.files (/usr/local/lib/node_modules/@vue/cli/lib/GeneratorAPI.js:312:27)
    at Generator.resolveFiles (/usr/local/lib/node_modules/@vue/cli/lib/Generator.js:268:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Minalien commented 3 years ago

I'm seeing the exact same error. It seems like the TypeScript files aren't copied over for the currently-available version of the plugin.

Taking a peek into my node_modules shows them missing: image

Minalien commented 3 years ago

@MRmlik12 Don't know if you need it but just in case you do and it helps, you can do this as a workaround until they fix the issue. I did it through CLI but afaik it should work fine if using the web UI as well.

  1. Clone this repository (or download the ZIP through GitHub, I'm not your mother).
  2. Run vue add vuetify
  3. Proceed as normal until the step that asks you to select your preset. Do not select the V3 or Vite presets yet.
  4. Copy the v3 folder from the packages/vue-cli-plugin-vuetify/generator/templates folder in the cloned repository, and paste it into your project's node_modules/vue-cli-plugin-vuetify/generator/templates/ (make sure you allow it to overwrite the existing folder). This will copy over all of the missing TypeScript files.
  5. Select the appropriate pre-set in your Vue CLI or web UI, and continue as normal.
MRmlik12 commented 3 years ago

@Minalien thanks for this solution. It works!

MRmlik12 commented 3 years ago

Oh, I found new problem running vue-cli-service

Error: [VuetifyLoaderPlugin Error] No matching rule for vue-loader found.
Make sure there is at least one root-level rule that uses vue-loader and VuetifyLoaderPlugin is applied after VueLoaderPlugin.
    at VuetifyLoaderPlugin.apply (/home/mrmlik12/Projects/wulkanowy-web/frontend/node_modules/vuetify-loader/lib/plugin.js:15:13)
    at webpack (/home/mrmlik12/Projects/wulkanowy-web/frontend/node_modules/webpack/lib/webpack.js:51:13)
    at serve (/home/mrmlik12/Projects/wulkanowy-web/frontend/node_modules/@vue/cli-service/lib/commands/serve.js:163:22)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
ElijahKotyluk commented 3 years ago

@MRmlik12 The TypeScript issue should be resolved in the latest release, the .ts files were not published until the most release. Are you still having issues with vue-loader?

ThaDaVos commented 2 years ago

@MRmlik12 The TypeScript issue should be resolved in the latest release, the .ts files were not published until the most release. Are you still having issues with vue-loader?

Sadly it is not solved... there are missing again

ThaDaVos commented 2 years ago

Even missing in the repo itself: https://github.com/vuetifyjs/vue-cli-plugins/tree/master/packages/vue-cli-plugin-vuetify/generator/templates/v3/src

For now I copied it from default/src