react-component / react-component/cascader

problems with yarn berry / pnp setups

Open
#453 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
233
Forks
149
Avg merge
10h 23m
Merged PRs (30d)
2

Description

When using yarn berry, I am getting:

../../.yarn/__virtual__/rc-cascader-virtual-b23b4687e9/3/.yarn/berry/cache/rc-cascader-npm-3.20.0-70d36b442e-10c0.zip/node_modules/rc-cascader/lib/Cascader.d.ts:1:40 - error TS2307: Cannot find module '@rc-component/trigger/lib/interface' or its corresponding type declarations.

1 import type { BuildInPlacements } from '@rc-component/trigger/lib/interface';
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error in ../../.yarn/__virtual__/rc-cascader-virtual-b23b4687e9/3/.yarn/berry/cache/rc-cascader-npm-3.20.0-70d36b442e-10c0.zip/node_modules/rc-cascader/lib/Cascader.d.ts:1

using:

cat .yarnrc.yml

nodeLinker: pnp

however, with this, it will work:

cat .yarnrc.yml

nodeLinker: node-modules

Contributor guide

No contributing guide indexed for this repository

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

Reproduce the TypeScript error with the .yarnrc.yml setting nodeLinker: pnp, then compare it with nodeLinker: node-modules. Start from the failing rc-cascader/lib/Cascader.d.ts import and inspect how the @rc-component/trigger dependency is resolved under Yarn Berry PnP. Done means the PnP setup type-checks without TS2307 while preserving the working node-modules setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
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.