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

Typescript 4.5 + yarn pnp issues #46874

Closed
billyvg opened this issue Nov 19, 2021 · 2 comments
Closed

Typescript 4.5 + yarn pnp issues #46874

billyvg opened this issue Nov 19, 2021 · 2 comments

Comments

@billyvg
Copy link

billyvg commented Nov 19, 2021

Bug Report

πŸ”Ž Search Terms

yarn
yarn3
pnp
berry
cannot find module

πŸ•— Version & Regression Information

4.5.x

  • This changed between versions 4.4 and 4.5___

⏯ Playground Link

N/A, view repo below

Playground link with relevant code

πŸ’» Code

Minimal reproducible repo here: https://github.com/billyvg/yarn-pnp-ts-4.5

git clone
yarn
yarn tsc

πŸ™ Actual behavior

It fails to build: https://github.com/billyvg/yarn-pnp-ts-4.5/runs/4268834214?check_suite_focus=true#step:5:4

migrations/20210209131202_initial-schema.ts:1:22 - error TS2307: Cannot find module 'knex' or its corresponding type declarations.

1 import { Knex } from 'knex';

πŸ™‚ Expected behavior

It should build successful. If I change nodeLinker to node-modules (instead of pnp), typescript@4.5 works fine. Likewise, downgrading to typescript@4.4 will also work with PnP.

@merceyz
Copy link

merceyz commented Nov 21, 2021

See yarnpkg/berry#3722 (specifically yarnpkg/berry#3722 (comment))

@billyvg
Copy link
Author

billyvg commented Nov 21, 2021

Thanks, closing as this is a yarn issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants