2

I set up a new Vue 3.0 application using

vue create

Then I add apollo to my application using

vue add apollo

Then when I run npm run build I get the following error

ERROR  Failed to compile with 2 errors                                                                                                    

Module Error (from ./node_modules/vue-loader/lib/index.js):


Vue packages version mismatch:

- [email protected] (C:\workspace\StatusTool\dummy-project\node_modules\vue\index.js)
- [email protected] (C:\workspace\StatusTool\dummy-project\node_modules\vue-template-compiler\package.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.


Module build failed (from ./node_modules/vue-loader/lib/index.js):
TypeError: Cannot read property 'parseComponent' of undefined
    at parse (C:\workspace\StatusTool\dummy-project\node_modules\@vue\component-compiler-utils\dist\parse.js:15:23)
    at Object.module.exports (C:\workspace\StatusTool\dummy-project\node_modules\vue-loader\lib\index.js:67:22)

What am I doing wrong?

Version Information:

  • @vue/cli: 4.5.6
  • vue-cli-plugin-apollo: "0.22.2"
  • apollo: 2.31.0

Seems like package vue-apollo is not installed

2
  • what's the vue-apollo version? Commented Sep 25, 2020 at 11:45
  • Added version information to question. Can't find vue-apollo in the list of installed packages. Commented Sep 27, 2020 at 16:11

1 Answer 1

2

Do not use vue/cli: 4.5.6 instead you need to use Manual install

vue add apollo is only for vue-cli 3 projects.

It is simple to install.

npm install --save vue-apollo graphql apollo-boost

or

yarn add vue-apollo graphql apollo-boost

You still will be able to use apollo-boost

Sign up to request clarification or add additional context in comments.

2 Comments

Where would I find information about all the other pitfalls I'm going to encounter when using Vue 3.0?
vue-cli 3 is different project then vue.js version 3. There will be no problem when using vuejs version 3 when it will be released. But current version of vuejs is v2.6.11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.