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 packages version mismatch #1339

Closed
jakobrosenberg opened this issue Oct 1, 2020 · 13 comments
Closed

Vue packages version mismatch #1339

jakobrosenberg opened this issue Oct 1, 2020 · 13 comments
Assignees

Comments

@jakobrosenberg
Copy link

I'm trying to document a small project:

  ...
  "dependencies": {
    "dotenv": "^8.2.0"
  },
  "devDependencies": {
    "ava": "^3.13.0",
    "documentation": "^13.0.2"
  },

Whenever I run npx document or pnpx document I get the error:

Vue packages version mismatch:

- vue@3.0.0 (<pnpm workspace>\node_modules\.pnpm\vue@3.0.0\node_modules\vue\index.js)
- vue-template-compiler@2.6.12 (<pnpm workspace>\node_modules\.pnpm\vue-template-compiler@2.6.12\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.

I'm using pnpm as package manager and have no Vue projects, but I do have one vite project.

@tmcw
Copy link
Member

tmcw commented Nov 14, 2020

This is, as far as I can tell, a limitation of pnpm - it doesn't allow more than one version of a module. That's pretty unfortunate, but it's not something that I think is fixable on the documentation.js side: we need that dependency in order to support vue projects.

@tmcw tmcw closed this as completed Nov 14, 2020
@jakobrosenberg
Copy link
Author

Thanks for the reply. I've tried with vanilla npm but am getting the same error. I'm not using Vue in my own project.

@p3k
Copy link

p3k commented Nov 18, 2020

same error here, not using pnpm:

→ documentation --version
/home/tobi/Projects/modul/portal/client/node_modules/vue-template-compiler/index.js:10
  throw new Error(
  ^

Error: 

Vue packages version mismatch:

- vue@3.0.0 (/home/tobi/Projects/modul/portal/client/node_modules/vue/index.js)
- vue-template-compiler@2.6.12 (/home/tobi/Projects/modul/portal/client/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.

    at Object.<anonymous> (/home/tobi/Projects/modul/portal/client/node_modules/vue-template-compiler/index.js:10:9)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/tobi/Projects/modul/portal/client/node_modules/documentation/src/parsers/vue.js:2:21)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
→ yarn list | grep -E '(vue|documentation)' 
├─ @vue/compiler-core@3.0.0
│  ├─ @vue/shared@3.0.0
├─ @vue/compiler-dom@3.0.0
│  ├─ @vue/compiler-core@3.0.0
│  └─ @vue/shared@3.0.0
├─ @vue/compiler-sfc@3.0.0
│  ├─ @vue/compiler-core@3.0.0
│  ├─ @vue/compiler-dom@3.0.0
│  ├─ @vue/compiler-ssr@3.0.0
│  ├─ @vue/shared@3.0.0
├─ @vue/compiler-ssr@3.0.0
│  ├─ @vue/compiler-dom@3.0.0
│  └─ @vue/shared@3.0.0
├─ @vue/reactivity@3.0.0
│  └─ @vue/shared@3.0.0
├─ @vue/runtime-core@3.0.0
│  ├─ @vue/reactivity@3.0.0
│  └─ @vue/shared@3.0.0
├─ @vue/runtime-dom@3.0.0
│  ├─ @vue/runtime-core@3.0.0
│  ├─ @vue/shared@3.0.0
├─ @vue/shared@3.0.0
├─ documentation@13.1.0
│  ├─ vue-template-compiler@^2.5.16
├─ vue-loader@16.0.0-beta.7
├─ vue-template-compiler@2.6.12
├─ vue@3.0.0
│  ├─ @vue/compiler-dom@3.0.0
│  ├─ @vue/runtime-dom@3.0.0
│  └─ @vue/shared@3.0.0

could someone please reopen this issue?

@tmcw tmcw reopened this Nov 18, 2020
@jakobrosenberg
Copy link
Author

I solved the problem by deleting the package from the cache. Somehow npm was resolving the package from pnpm's cache path.

@p3k
Copy link

p3k commented Nov 19, 2020

(Removed my prematurely worded comment; still diggin’…)

@p3k
Copy link

p3k commented Nov 19, 2020

thanks for the update @jakobrosenberg

i am using yarn in my setup and after running yarn cache clean and another yarn install i still get the error.

the confusing thing is this: documentationjs’ package.json explicitely states vue-template-compiler@2.5.16 as a direct dependency.

however, running yarn why vue-template-compiler gives me this output:

yarn why v1.22.10
[1/4] Why do we have the module "vue-template-compiler"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "vue-template-compiler@2.6.12"
info Reasons this module exists
   - "documentation" depends on it
   - Hoisted from "documentation#vue-template-compiler"
info Disk size without dependencies: "444KB"
info Disk size with unique dependencies: "600KB"
info Disk size with transitive dependencies: "600KB"
info Number of shared dependencies: 2
Done in 1.40s.

is yarn automatically upgrading 2.5.16 to 2.6.12 (because of the ^?) and documentionjs got 2.5.16 hard-coded somewhere?

i feel quite stymied trying to solve this…

which version of vue-template-compiler is installed in your setup now, @jakobrosenberg?

@p3k
Copy link

p3k commented Nov 19, 2020

oh and regarding the suggestions in the error message:

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.

not very helpful either as i installed vue-loader@16.0.0-beta.7 and obviously vue-template-compiler in the latest version, anyway (2.6.12 – the one documentjs complaining about)…

@MMohesen
Copy link

MMohesen commented Dec 4, 2020

the same here

@Exlord
Copy link

Exlord commented Mar 13, 2021

Same here, Any update on this? how to use with vue 3?

@p3k
Copy link

p3k commented Apr 19, 2021

bump

@tmcw
Copy link
Member

tmcw commented Apr 19, 2021

Please do not bump issues. See the maintenance status for a summary of the approach for this project: if you want to dig into this project, find a fix, and submit a PR, I will be more than happy to review, merge, and release it.

@p3k
Copy link

p3k commented Apr 20, 2021

thanks for the update @tmcw was not aware bumping an issue is frowned upon (on the other hand i would not have found out about the maintenance status if i had not).

@anthony-redFox
Copy link
Member

I'll take a look

@anthony-redFox anthony-redFox self-assigned this Apr 21, 2021
anthony-redFox added a commit to anthony-redFox/documentation that referenced this issue Apr 21, 2021
Vue dependencies was moved to optionalDependencies
So, that mean if you need Vue support you also have to add in own package.json
new dependency for Vue 2 is vue-template-compiler, Vue 3 is @vue/compiler-sfc
anthony-redFox added a commit to anthony-redFox/documentation that referenced this issue Apr 21, 2021
Vue dependencies was moved to optionalDependencies
So, that mean if you need Vue support you also have to add in own package.json
new dependency for Vue 2 is vue-template-compiler, Vue 3 is @vue/compiler-sfc
@tmcw tmcw closed this as completed in cd7d123 Apr 21, 2021
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

6 participants