Skip to content

Typescript 4.5 + yarn pnp issuesΒ #46874

Closed
@billyvg

Description

@billyvg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions