vitest-dev / vitest-dev/vitest

Dependency resolution issue with a shared library in a monorepo setup

Open
#3,919 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pending triage
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

See this repo.

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.