Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue3 Installation error : Error: You cannot call "get" on a collection with no paths. #438

Open
mathieutu opened this issue Oct 7, 2020 · 3 comments

Comments

@mathieutu
Copy link
Contributor

Hi @Akryum.

I got this error with @vue/cli 4.5.6 and vue 3.0.0 when trying to install.

Thanks.

λ › vue add apollo            

📦  Installing vue-cli-plugin-apollo...

yarn add v1.22.10
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ [email protected]
info All dependencies
└─ [email protected]
✨  Done in 7.93s.
✔  Successfully installed plugin: vue-cli-plugin-apollo

? Add example code Yes
? Add a GraphQL API Server? No
? Configure Apollo Engine? No

🚀  Invoking generator for vue-cli-plugin-apollo...
 ERROR  Error: You cannot call "get" on a collection with no paths. Instead, check the "length" property first to verify at least 1 path exists.
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 (/Users/mathieutu/.config/yarn/global/node_modules/jscodeshift/src/Collection.js:213:13)
    at injectOptions (/Users/mathieutu/.config/yarn/global/node_modules/@vue/cli/lib/util/codemods/injectOptions.js:15:6)
    at runTransformation (/Users/mathieutu/.config/yarn/global/node_modules/vue-codemod/dist/src/run-transformation.js:61:17)
    at /Users/mathieutu/.config/yarn/global/node_modules/@vue/cli/lib/Generator.js:290:23
    at Array.forEach (<anonymous>)
    at Generator.resolveFiles (/Users/mathieutu/.config/yarn/global/node_modules/@vue/cli/lib/Generator.js:276:24)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Generator.generate (/Users/mathieutu/.config/yarn/global/node_modules/@vue/cli/lib/Generator.js:175:5)
    at async runGenerator (/Users/mathieutu/.config/yarn/global/node_modules/@vue/cli/lib/invoke.js:111:3)
    at async invoke (/Users/mathieutu/.config/yarn/global/node_modules/@vue/cli/lib/invoke.js:92:3)
@mathieutu mathieutu reopened this Oct 7, 2020
@mathieutu
Copy link
Contributor Author

mathieutu commented Oct 7, 2020

Actually I followed thi comment and it worked:
vuetifyjs/vue-cli-plugins#140 (comment)

This is due to vue 3 incompatibility.

Add

new Vue({
    render: h => h(App),
}).$mount('#app');

in your main file and remove it afterwards.

EDIT:
In fine it doesn't work anyway because the provided version and files are not compatible with vue-cli 3. 😞

@mathieutu mathieutu changed the title Installation ERROR : Error: You cannot call "get" on a collection with no paths. Vue3 Installation error : Error: You cannot call "get" on a collection with no paths. Oct 7, 2020
@andreasmalaer
Copy link

In fine it doesn't work anyway because the provided version and files are not compatible with vue-cli 3. 😞

@mathieutu I ran into the same issue. However, @vue/apollo-composable works with Vue 3 after manual installation and the following repo shows how https://github.com/GraphQLGuide/guide-vue

@twelve17
Copy link

twelve17 commented Jun 9, 2022

Is vue-cli-plugin-apollo still not compatible with Vue 3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants