vitest-dev / vitest-dev/vitest
Dependency resolution issue with a shared library in a monorepo setup
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17.1k
- Forks
- 2k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 94
Description
Describe the bug
Hi vitest team,
At a high level, in a monorepo setup with a shared library dependency which defines a component which relies on 'react' package, this 'react' package is not resolved within the dependencies of the final project, contrary to vite.
Please see the README in the repro github repository for the more detailled explanation.
Thanks in advance !
Reproduction
System Info
System:
OS: Windows 10 10.0.22621
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 17.25 GB / 31.85 GB
Binaries:
Node: 16.14.2 - D:\softwares\nodejs\node.EXE
Yarn: 1.22.4 - D:\softwares\Yarn\bin\yarn.CMD
npm: 9.6.7 - D:\softwares\nodejs\npm.CMD
Browsers:
Chrome: 115.0.5790.171
Edge: Spartan (44.22621.1992.0), Chromium (115.0.1901.188)
Internet Explorer: 11.0.22621.1
Used Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the README in the linked vitest-react-select-repro repository and run its Yarn reproduction to observe how the shared library's React dependency is resolved. Trace the Vitest dependency-resolution path and compare it with Vite; the work is done when the final project resolves the shared library's React dependency consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, react, typescript, vite
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100