Closed phloose closed 2 years ago
Seeing the same thing here in a non-proprietary repo if it's helpful: https://github.com/josephlbarnett/quizzy/pull/1068/ (failed build logs here: https://app.circleci.com/pipelines/github/josephlbarnett/quizzy/1690/workflows/d58f4634-db27-4f1e-9065-4709dc7dd24c/jobs/1729 )
I'm getting similar errors in a project using Vue 3 SFCs and Typescript
it looks like in my case a dependency on "@babel/preset-env": "^7.17.10"
was pulling in source-map@0.5.7
, possibly causing an incompatibility with source-map@0.6.1
pulled in by jest 28. bumping "@babel/preset-env": "^7.18.2"
removes that transitive source-map dependency and appears to fix this particular issue.
What's weird is that vue2-jest declares a dependency on source-map@0.5.6
, but seems to work anyway?:
├─┬ @vue/vue2-jest@28.0.0
│ ├─┬ @vue/component-compiler-utils@3.3.0
│ │ ├─┬ merge-source-map@1.1.0
│ │ │ └── source-map@0.6.1
│ │ ├─┬ postcss@7.0.39
│ │ │ └── source-map@0.6.1 deduped
│ │ └── source-map@0.6.1
│ └── source-map@0.5.6
├─┬ jest@28.1.1
│ └─┬ @jest/core@28.1.1
│ ├─┬ @jest/reporters@28.1.1
│ │ └─┬ istanbul-lib-source-maps@4.0.1
│ │ └── source-map@0.6.1
│ └─┬ jest-runner@28.1.1
│ └─┬ source-map-support@0.5.13
│ └── source-map@0.6.1
Wouldn't this error be resolved? I'm using vue3-jest right now and using vite as my build tool, I'm getting the same error and it's not resolved.
Can this be related to https://github.com/vuejs/vue-test-utils/issues/1989?
Although that issue occurs with v27 and v26 (with vue-jest
instead of @vue/vue2-jest
) as well.
I am sure the issue is here, not test utils.
Maybe fixed here: https://github.com/vuejs/vue-jest/pull/486#pullrequestreview-1059587403
@cj848 This issue is specifically for V2 - I thought for Vue 3 + the latest vue3-jest solved this, what version are you on?
I am sure the issue is here, not test utils.
Maybe fixed here: #486 (review)
@cj848 This issue is specifically for V2 - I thought for Vue 3 + the latest vue3-jest solved this, what version are you on?
I have confirmed that the test works normally based on the latest versions. Thank you.
I can also confirm that https://github.com/vuejs/vue-jest/pull/486#pullrequestreview-1059587403 solves https://github.com/vuejs/vue-test-utils/issues/1989
@lmiller1990 it does look like this broke in 28.1.0 where i somehow managed to have it working in 28.0.1 (see my above npm list comment)...
@josephlbarnett weird - this PR https://github.com/vuejs/vue-jest/pull/486 was supposed to fix source maps in Vue 2.
Edit: maybe this will fix it: https://github.com/vuejs/vue-jest/pull/489
Its even stranger, I had it failing locally and was messing with forcing the same version of source-map
everywhere (0.6.1) when it suddenly started working. Now even if I revert all my changes, rm -rf node_modules and start over, I can't get it to fail again locally (but it does still fail in CI).
I was reading #474 and #486 and how they didn't seem to quite fix it.
just wanted to say #489 also does not fix it for me
this is 28.1.0 compared with that PR. It's different, but nether is correct
one weird thing is if on 28.1.0 i add an error above the line where it should be then it works correctly. I don't understand it enough to know why though..
oh the issue seems to be some caching
if i run npm test -- --no-cache
it works correct only 28.1.0, but as soon as i remove it it goes back to wrong
edit:: npm test -- --clearCache
resolved it all
final test results with cache issue resolved
28.0.0 - wrong maps 28.1.0 - correct 🎉
clearing cache helps this make more sense and fail reproducibly, thanks.
I see errors due to "bad source maps" (specifically seems like source map entries refer to name indices beyond the # of names in the names array, but this is over my head) in 28.1.0, even with #489. but somehow did get it working in 28.0.1 (see above)
hmm everything seems to work ok in my project now with 29.x... not sure what fixed it but :shrug:
After upgrading to Jest v28 SFCs that are using TypeScript and the Composition-API plugin for Vue2 are producing a weird error:
It seems to me, that vue2-jest cannot produce source-maps or creates them i a way that is not consumable by the underlying source-map lib.
Relevant packages installed in a node 16 environment with npm 8 are:
I know that these version do not match exactly, but it makes no difference: Even if i downgrade all to exactly v28.0.0 it does not work
The transformers property lists
@vue/vue2-jest
correctly for transforming vue files, which also worked for vue-jest v27 and jest 27. I have also tried to include the full path in node modules like<rootDir>/node_modules/@vue/vue2-jest
, but without success.Unfortunatly i cannot include a repo link since its proprietary software.
Am i missing something in the way to upgrade to jest v28 or is this a bug?