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

vue-apollo support #1122

Closed
khaledosman opened this issue May 5, 2020 · 1 comment
Closed

vue-apollo support #1122

khaledosman opened this issue May 5, 2020 · 1 comment

Comments

@khaledosman
Copy link

khaledosman commented May 5, 2020

Version

3.0.0-beta.9

Reproduction link

https://github.com/khaledosman/learning-vue

Steps to reproduce

vue add vue-next
vue add apollo
or trying to integrate vue-apollo otherwise

What is expected?

integration should work as expected in docs

What is actually happening?

vue add apollo fails with

🚀  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 (/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 newTransform (/usr/local/lib/node_modules/@vue/cli/node_modules/vue-jscodeshift-adapter/src/jscodeshift-mode.js:9:14)
    at runCodemod (/usr/local/lib/node_modules/@vue/cli/lib/util/runCodemod.js:29:26)
    at /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 processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Generator.generate (/usr/local/lib/node_modules/@vue/cli/lib/Generator.js:175:5)
    at async runGenerator (/usr/local/lib/node_modules/@vue/cli/lib/invoke.js:109:3)

After manual setup I get one of these two errors

vue-apollo.esm.js?522d:2020 Uncaught TypeError: Cannot read property 'substr' of undefined
    at Function.install (vue-apollo.esm.js?522d:2020)
    at Object.use (runtime-core.esm-bundler.js?5c40:2110)
    at eval (main.js?56d7:11)
    at Module../src/main.js (app.js:1358)
    at __webpack_require__ (app.js:854)
    at fn (app.js:151)
    at Object.1 (app.js:1491)
    at __webpack_require__ (app.js:854)
    at checkDeferredModules (app.js:46)
    at app.js:994

or

vue-apollo.esm.js?522d:3618 Uncaught TypeError: Object.defineProperty called on non-object
    at Function.defineProperty (<anonymous>)
    at Function.install (vue-apollo.esm.js?522d:3618)
    at Object.use (runtime-core.esm-bundler.js?5c40:2110)
    at eval (main.js?56d7:11)
    at Module../src/main.js (app.js:1358)
    at __webpack_require__ (app.js:854)
    at fn (app.js:151)
    at Object.1 (app.js:1491)
    at __webpack_require__ (app.js:854)
    at checkDeferredModules (app.js:46)

vuejs/apollo#972

I also noticed its not in the planned supported packages in the README, are there any plans for apollo support in vue 3?

@LinusBorg
Copy link
Member

LinusBorg commented May 5, 2020

Hi!

It seems you opened this in the wrong repository because you are misunderstanding who supports what.

Therefore:

  • Vue 3 will not support apollo directly, and never has.
  • vue-apollo is a plugin for Vue
  • vue-apollo will support Vue 3, and right now, it has to keep up with changes in the beta.
  • If it does lead to a bug right now, open an issue in their repo.
  • However, I assume that the cli plugin which you installed is the stable one, which only supports Vue 2. So it's not a bug - you installed something not compatible with Vue 3 yet - namely vue-cli-plugin-apollo

@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants