-
Notifications
You must be signed in to change notification settings - Fork 262
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
Bug: Yarn 2+ breaks on unlisted dependency #1306
Comments
Hmm I indeed removed the dependency in January (because I thought we were no longer using it, but we still are as I just realised). The strange thing is that we did not release this change: rc.18 was released in December. So it's weird that you have this issue with rc.18 🤔 Do you also have it with rc.17 or older versions? Anyway, I'll revert my mistake, and this will hopefully fix your issue when a make a new release. |
I think you're right on that commit not being the issue here, my apologies. I've only just noticed this after scaffolding my first Vue 3 project, I've just tested with a bunch of versions starting at rc.1 all the way up to rc.18 and I do indeed have the issue in all versions I tested although I skipped over a lot of them. I wondered if this might be caused by the pnp typescript plugin so I have done another scaffold with the following setup but get the same issue: npm init vue@latest Vue.js - The Progressive JavaScript Framework √ Project name: ... test Scaffolding project in D:\Repos\Personal\test... cd test FAIL src/components/__tests__/HelloWorld.spec.js [ src/components/__tests__/HelloWorld.spec.js ]
Error: @vue/test-utils tried to access @vue/compiler-dom, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: @vue/compiler-dom (via "@vue\compiler-dom")
Required by: @vue/test-utils@virtual:572974bfd16fba63746e564b946fcd0d5481e3958a2d86b2339f8f9624fc9f4abd3898c4444c731638d6001d3f88ca414f2c05308d6789925602f170e2d31abc#npm:2.0.0-rc.18 |
Hmm yeah, that's what I suspected... I'm not familiar with Yarn 2 myself but I don't think we're doing anything special here. So it's maybe an issue with Yarn itself? We have no issues with other package managers as far as I know (yarn v1, pnpm, or npm v6-8). Maybe try to update your yarn version to be sure that you have the latest fixes, as there are a lot of similar issues in the Yarn repo. Other than that, I don't know how we can help. Maybe try to open an issue on the yrn repo, and link it back to here if your problem persists with the latest yarn versions. |
I'm using the latest release of Yarn (3.1.1), I have found a workaround though that works with Yarn 2+ if anyone else runs into this issue. Try enabling the loose pnpMode |
Awesome, thanks @Benalink |
Describe the bug
Running vitest with yarn on a newly scaffolded vue project fails.
FAIL src/components/tests/HelloWorld.spec.ts [ src/components/tests/HelloWorld.spec.ts ]
Error: @vue/test-utils tried to access @vue/compiler-dom, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound
This appears to be a regression of #245 after the dependency was removed in #1251
To Reproduce
npm init vue@latest
yarn install (with version 2+)
yarn run vitest
Expected behavior
Tests run succesfully
Related information:
@vue/test-utils
version: 2.0.0-rc.18Vue
version: 3node
version:npm
(oryarn
) version: yarn 2+The text was updated successfully, but these errors were encountered: