Skip to content
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: Cannot find module '@vue/server-renderer' #2218

Closed
chrisjbrown opened this issue Oct 18, 2023 · 6 comments
Closed

Bug: Cannot find module '@vue/server-renderer' #2218

chrisjbrown opened this issue Oct 18, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@chrisjbrown
Copy link

Describe the bug
I'm using these dependencies for testing
"@testing-library/jest-dom": "^5.16.5", "@testing-library/vue": "^6.6.1", "@vue/test-utils": "^2.2.6", "@vue/vue3-jest": "^29.2.2", "jest": "^29.3.1", "jest-environment-jsdom": "^29.3.1",

When running yarn test I'm receiving this error

`
Test suite failed to run

Cannot find module '@vue/server-renderer' from '/project_path/.yarn/__virtual__/@vue-test-utils-virtual-7528046424/0/cache/@vue-test-utils-npm-2.4.1-9433e5afe3-901b6a5170.zip/node_modules/@vue/test-utils/dist'

Require stack:
  /project_path/.yarn/__virtual__/@vue-test-utils-virtual-7528046424/0/cache/@vue-test-utils-npm-2.4.1-9433e5afe3-901b6a5170.zip/node_modules/@vue/test-utils/dist/vue-test-utils.cjs.js
  /project_path/.yarn/__virtual__/@testing-library-vue-virtual-9373cb4b8b/0/cache/@testing-library-vue-npm-6.6.0-6f4ee0052f-3e89e05ca1.zip/node_modules/@testing-library/vue/dist/render.js
  /project_path/.yarn/__virtual__/@testing-library-vue-virtual-9373cb4b8b/0/cache/@testing-library-vue-npm-6.6.0-6f4ee0052f-3e89e05ca1.zip/node_modules/@testing-library/vue/dist/index.js
  jest.setup.js

  4 | import "@testing-library/jest-dom";
  5 |
> 6 | import { configure } from "@testing-library/vue";
    | ^
  7 | import { config } from "@vue/test-utils";
  8 | import { lazyLoadImages } from "src/js/helpers/lazyLoadImages";

`

To Reproduce
working on creating minimum stack blitz repo

Expected behavior
I'm not doing any server side rendering or testing. I would not expect '@vue/server-renderer' to be referenced at all

@chrisjbrown chrisjbrown added the bug Something isn't working label Oct 18, 2023
@davidmatter
Copy link

Have you installed the following packages?

   "@vue/compiler-sfc": ">= 3",
   "vue": ">= 3"

@chrisjbrown
Copy link
Author

chrisjbrown commented Oct 18, 2023

Have you installed the following packages?

   "@vue/compiler-sfc": ">= 3",
   "vue": ">= 3"

yes
"vue": "^3.2.45", "@vue/compiler-sfc": "^3.2.39"

@cexbrayat
Copy link
Member

Which version of Yarn do you use?

I think it's probably the same issue than #2107
We have a PR in progress to solve this, see #2197

In the meantime you can add @vue/server-renderer to your dev dependencies

@chrisjbrown
Copy link
Author

Which version of Yarn do you use?
3.5.0

@chrisjbrown
Copy link
Author

In the meantime you can add @vue/server-renderer to your dev dependencies

oddly tests still fail with the same error

@cexbrayat
Copy link
Member

cexbrayat commented Oct 18, 2023

Ok, this is a duplicate of #2107
As the other one has a repro and a PR to fix it, I'll close this one as duplicate

@cexbrayat cexbrayat closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants