Open sceee opened 3 years ago
I could further trace down where this issue results from.
It seems this is caused by dependency conflict between different core-js
versions caused by the project structure.
The project structure is as follows:
package.json
package-lock.json
tsconfig.json
jest.config.js
package.json
package-lock.json
tsconfig.json
In project1's tsconfig.json
, the path to SomeShared.ts
from project2 is included via:
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "../project2/functions/shared/**/*.ts", "tests/**/*.ts", "tests/**/*.tsx"],
The intention here is to just include some shared files from one central location (they are also used in another project).
So now, what happened was that the versions of core-js
got out of sync:
node_modules 1
contained core-js
3.19.1node_modules 2
contained core-js
3.6.5And it seems that jest somehow tries to resolve core-js
from node_modules 2" when executing the unit tests of
project1(instead of resolving it from
node_modules 1`).
Is jest somehow incorrectly configured for this setup?
A workaround is to install core-js
in the same version in project2. Then the unit tests work again but it feels incorrect that jest (executed by vue-cli) tries to resolve core-js
from project2 instead of project1 when the unit tests of project1 are executed.
Can this somehow be configured that it just takes the node_modules
from the own project?
If that's no vue-cli issue, please let me know as I'm not ultimately sure where this comes from (whether it's from @vue/cli-plugin-unit-jest/presets/typescript-and-babel
, jest
, @vue/cli
or an incorrect configuration).
Any hint is appreciated!
Any luck? I'm encountering this as well
I had the same problem. Updating core-js
to 3.22.2
helped fix the issue.
Version
5.0.0-rc.0
Environment info
Steps to reproduce
Unfortunately, I don't know how to reproduce this.
What is expected?
Unit tests can be executed successfully as they can with v5.0.0-beta.7.
What is actually happening?
Some tests fail with the following error message:
This happens only with some specific tests after upgrading from v5.0.0-beta.7 to v5.0.0-rc.0.