yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.44k stars 1.11k forks source link

[Bug?]: sdk typescript compiling broken on version 5.5.3 #6395

Open ubugnu opened 4 months ago

ubugnu commented 4 months ago

Self-service

Describe the bug

Many typescript errors appeared on my editors (vscode and nvim) when I upgraded typescript from evrsion 5.4.5 to the latest version 5.5.3. Compiling with ./.yarn/sdks/typescript/bin/tsc is causing "Module not found" errors.

To reproduce

yarn init
yarn add -D typescript@5.5.3
yarn dlx @yarnpkg/sdks base
yarn add lodash
echo 'import _ from "lodash";' > index.ts
./.yarn/sdks/typescript/bin/tsc index.ts --noEmit --skipLibCheck

Environment

System:
    OS: Linux 6.8 Ubuntu 24.04 LTS 24.04 LTS (Noble Numbat)
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
  Binaries:
    Node: 20.11.1 - /tmp/xfs-507afb7e/node
    Yarn: 4.1.1 - /tmp/xfs-507afb7e/yarn
    npm: 10.2.4 - ~/.n/n/versions/node/20.11.1/bin/npm
    bun: 1.0.31 - ~/.bun/bin/bun

Additional context

Possible fix:

yarn add -D typescript@5.4.5
SheepReaper commented 4 months ago

I think my problem is related to yours: https://github.com/yarnpkg/berry/issues/6380

downgrading to 5.4.5 as suggested, resolves my issue as well. I pointed out that it's to do with pnp, which if I recall, you are also using. I'm using yarn@4.3.1 which is newer than yours and the problem still appears.

ubugnu commented 4 months ago

I think my problem is related to yours: https://github.com/yarnpkg/berry/issues/6380

downgrading to 5.4.5 as suggested, resolves my issue as well. I pointed out that it's to do with pnp, which if I recall, you are also using. I'm using yarn@4.3.1 which is newer than yours and the problem still appears.

Effectively I'm using pnp

uigywnkiub commented 3 months ago

The bug appeared with my GH Actions CI when I upgraded Yarn to 4.4.0 from 4.3.0, and the typescript does not match the local typescript checking, on CI errors on locally fine.