Open baffalop opened 4 months ago
Update: I was mistaken about versions. My ^3.3.4
actually resolved to 3.4. When I pin both vue
and @vue/compat
to ~3.3.4
the issue goes away. This fits with https://github.com/vuejs/core/issues/10148 which reports the error as only present on 3.4, not 3.3.
Is there any update on this issue further, I am also getting this issue in my project.
The problem is caused by incompatible dependency versions, Vue
depends on entities:^4.5.0
, but there are other packages that depend on entities:^2.2.0
, for some reason the dependency installed by yarn
is only entities:^2.2.0
, which leads to runtime errors.
I tried to use npm, pnpm
to install the dependency is not error, just for reference.
Vue version
3.4.21 (with @vue/compat 3.4.21)
Link to minimal reproduction
https://stackblitz.com/edit/vue2-jest-8qoex3?file=jest.config.js&view=editor
Steps to reproduce
What is expected?
I would like to run unit tests with Vue Test Utils, while on the migration build. My application has Vue 2 dependencies which cause unit tests to fail when they are run with Vue 3. I would expect to be able to use the migration build to fix this by aliasing
vue
to@vue/compat
viamoduleNameMapper
. (This is the approach recommended by vue-test-utils-compat though the minimal reproduction uses latest@vue/test-utils
.)What is actually happening?
Running tests with
moduleNameMapper: { '^vue$': '@vue/compat' }
causes the following TypeError:System Info
Any additional comments?
This is the same error as in https://github.com/vuejs/core/issues/10148 though it doesn't affect me at build- or runtime, only in Jest.