-
Notifications
You must be signed in to change notification settings - Fork 156
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
Source maps for vue2 SFCs using TS are not created/wrongly created for v28 #474
Comments
Seeing the same thing here in a non-proprietary repo if it's helpful: josephlbarnett/quizzy#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 What's weird is that vue2-jest declares a dependency on
|
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 vuejs/vue-test-utils#1989? Although that issue occurs with v27 and v26 (with |
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 #486 (review) solves vuejs/vue-test-utils#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 #486 was supposed to fix source maps in Vue 2. Edit: maybe this will fix it: #489 |
Its even stranger, I had it failing locally and was messing with forcing the same version of |
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 edit:: final test results with cache issue resolved 28.0.0 - wrong maps |
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) |
When babel-jest merges the inputSourceMap and the outputSourceMap it appears to remove names from the resulting sourceMap that are still referenced by elements of the source map. Not passing the inputSourceMap appears to solve vuejs#474 and still provide source coverage, but someone who knows how this is supposed to work should look more closely.
hmm everything seems to work ok in my project now with 29.x... not sure what fixed it but 🤷 |
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?
The text was updated successfully, but these errors were encountered: