Open rajinder-yadav opened 3 years ago
try yarn add -D vue-loader@next
@avrelaun That fixed one problem, at least I a new module installed:
"vue-cli-plugin-apollo": "~0.22.2",
However I don't see @apollo/client
installed, which is what I expect.
Also I don't see any of the files generated and I still need to do those steps manually? I would expect the same behavior as with Angular for ng add apollo-angular
?
This is still broken imho.
need help! same issue
Same problem here
Same problem here
Same issue, why not fix
For people having this issue, this seems to have worked, at least to run vue add apollo
https://github.com/vuetifyjs/vue-cli-plugins/issues/140#issuecomment-670971894
Doesn't seem like it's the real solution; not sure where that needs to happen yet, here or in Vue. But it's a temporary fix at least
the same issue for me also. Files are not automatically added and had to add them manually but still was not working.(Using the vue add method)
this is the issue while running npm run serve
after running vue add apollo
{which failed}
**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.
Update: failed on Ubuntu also.
Update: My Cli version is 4 so I think that is why it is not working since it is designed for cli 3
Same issue,can anyone help here?
I believe vue add apollo
does not work well with Vue 3.
My project uses:
vue@3.2.5
vue-cli@4.5.13
vue-apollo@4.0.0-alpha.14
I stumbled upon that rabbit hole and how I got over:
Delete project folder previously created by vue-cli
and recreate it by vue-cli
. Please backup first and proceed at your discretion.
Use manual installation route instead:
npm install --save graphql graphql-tag @apollo/client
import { ApolloClient, createHttpLink, InMemoryCache } from '@apollo/client/core'
// HTTP connection to the API
const httpLink = createHttpLink({
// You should use an absolute URL here
uri: 'http://localhost:3020/graphql',
})
// Cache implementation
const cache = new InMemoryCache()
// Create the apollo client
const apolloClient = new ApolloClient({
link: httpLink,
cache,
})
Depending on your preference [Option API, Composition API, Component API], follow their setup
On Windows 10, I am having the exact same problem as the original post.
Precisely same issue: @vue/cli 5.0.4 "vue": "^3.2.13" "vue-cli-plugin-apollo": "~0.22." 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. / sigh /
Same error... fresh vite install with vue3
? 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 (C:\Users\xd1a2\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\jscodeshift\src\Collection.js:213:13)
at injectOptions (C:\Users\xd1a2\AppData\Roaming\npm\node_modules\@vue\cli\lib\util\codemods\injectOptions.js:15:6)
at runTransformation (C:\Users\xd1a2\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\vue-codemod\dist\src\runTransformation.js:60:17)
at C:\Users\xd1a2\AppData\Roaming\npm\node_modules\@vue\cli\lib\Generator.js:335:23
at Array.forEach (<anonymous>)
at Generator.resolveFiles (C:\Users\xd1a2\AppData\Roaming\npm\node_modules\@vue\cli\lib\Generator.js:321:24)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Generator.generate (C:\Users\xd1a2\AppData\Roaming\npm\node_modules\@vue\cli\lib\Generator.js:205:5)
at async runGenerator (C:\Users\xd1a2\AppData\Roaming\npm\node_modules\@vue\cli\lib\invoke.js:111:3)
at async invoke (C:\Users\xd1a2\AppData\Roaming\npm\node_modules\@vue\cli\lib\invoke.js:92:3)
does anyone find the solution for the above issue?
For people having this issue, this seems to have worked, at least to run
vue add apollo
vuetifyjs/vue-cli-plugins#140 (comment) Doesn't seem like it's the real solution; not sure where that needs to happen yet, here or in Vue. But it's a temporary fix at least
To those still asking for solutions, the above tip by kavisherlock does indeed work.
Don't install the Apollo example files if you're on Vue 3, installation will fail due to slot-scope depreciation.
Describe the bug
vue add apollo
fails with an error.To Reproduce Steps to reproduce the behavior:
Error message
Versions vue: @vue/cli 4.5.10 "vue-cli-plugin-apollo": "~0.22.2",
Additional context Add any other context about the problem here.
package.json