You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Apologies for not providing an actual SSCCE here. I'm hoping this is an obvious enough, "That ain't right!" issue that an actual reproduction case isn't needed. If it is, let me know and I'll put something together.)
What is expected?
The vue dependency should be a normal version string (e.g. Maybe "2.x")
What is actually happening?
It's... not.
Unfortunately, this causes problems with package manager tools like yarn. For example, I stumbled upon this issue because we're using Yarn workspaces. We have one workspace ("vue-2") that depends on vue@2 and another ("vue-3") that depends on vue@3. Normally, yarn install would be smart enough to keep the module trees separate. However, because of the non-standard dependency declaration here, yarn hoists vue-template-compiler into node_modules at the project root alongside the vue@3 dependencies. So when vue-template-compiler tries to load, it pulls in the wrong version of vue.
FWIW (and as a breadcrumb for others who may have this issue), the solution was to add a nohoist directive to the workspaces section of our project's package.json file.
Cc @ktsn and @yyx990803 : It looks like this dependency declaration was added in #7918. (commit here since that PR doesn't seem to want to show actual files or commits)
The text was updated successfully, but these errors were encountered:
Version
2.7.14
Reproduction link
https://github.com/vuejs/vue/blob/dev/packages/vue-template-compiler/package.json#L29
Steps to reproduce
file:../..
" version string.(Apologies for not providing an actual SSCCE here. I'm hoping this is an obvious enough, "That ain't right!" issue that an actual reproduction case isn't needed. If it is, let me know and I'll put something together.)
What is expected?
The
vue
dependency should be a normal version string (e.g. Maybe "2.x
")What is actually happening?
It's... not.
Unfortunately, this causes problems with package manager tools like
yarn
. For example, I stumbled upon this issue because we're using Yarn workspaces. We have one workspace ("vue-2") that depends onvue@2
and another ("vue-3") that depends onvue@3
. Normally,yarn install
would be smart enough to keep the module trees separate. However, because of the non-standard dependency declaration here, yarn hoistsvue-template-compiler
intonode_modules
at the project root alongside thevue@3
dependencies. So whenvue-template-compiler
tries to load, it pulls in the wrong version ofvue
.FWIW (and as a breadcrumb for others who may have this issue), the solution was to add a
nohoist
directive to theworkspaces
section of our project's package.json file.Cc @ktsn and @yyx990803 : It looks like this dependency declaration was added in #7918. (commit here since that PR doesn't seem to want to show actual files or commits)
The text was updated successfully, but these errors were encountered: