question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`render` requires projects to add `vuex` as a dependency

See original GitHub issue

Description

This project lists vuex as a dev dependency, but then the implementation of render requires vuex. As a result, consuming projects that may not use vuex in their project code need to add it as a dev dependency to use render in the test environment.

Steps to reproduce

  • Create a Vue project and add @testing-library/vue, or add @testing-library/vue to an existing project.
  • Ensure vuex is not a dependency in the project.
  • Try to write a test with render.
  • Observe the tests failing because Node can’t find vuex.

Expected behavior

I’d expect vuex to be a dependency and not a dev dependency of this project as one of its key exports requires vuex.

Related information

  • @testing-library/vue version: 5.8.2
  • Vue version: >= 2.6.11 < 3
  • node version: 12.22.7
  • npm (or yarn) version: npm 6.14.15

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
adam-giprilcommented, Dec 21, 2021

@afontcu I’ll get you something and ping again. Might not be today — the repo in question is private, and I’ll see if I can create a similar testing setup in a small public repo.

1reaction
afontcucommented, Dec 21, 2021

@adam-gipril could you provide a small reproduction link – with your mocha setup? I can’t find a way to reproduce it in several codebases, and now I’m starting to think it has to do with the test runner somehow

Read more comments on GitHub >

github_iconTop Results From Across the Web

peer dependency confilct when creating projects using vue 2 ...
Just curious, @cnakamoto did you try with adding the --legacy-peer-deps flag on npm install ? 7
Read more >
Vuex Tutorial - CodinGame
It will install all of our dependencies including Vuex library. Now, we need to create a webpack.config.js file for configuring webpack server.
Read more >
Failed to install Vuex in Vue3 - Stack Overflow
I want to install Vuex but I get an error. // error npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency...
Read more >
Adding server-side-rendering to existing vue 3 project
First we have to add few dependencies && devdependencies so that our project can support ssr. yarn add @vue/server-renderer vue@3.1.4.
Read more >
Installation - Vuex - Vue.js
Installation # ; <script src="/path/to/vue.js"></script> ; npm install vuex@next --save ; yarn add vuex@next --save ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found