berry icon indicating copy to clipboard operation
berry copied to clipboard

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

Open ubugnu opened this issue 1 year ago • 3 comments

Self-service

  • [ ] I'd be willing to implement a fix

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 [email protected]
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 [email protected]

ubugnu avatar Jul 11 '24 19:07 ubugnu

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 [email protected] which is newer than yours and the problem still appears.

SheepReaper avatar Jul 12 '24 22:07 SheepReaper

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 [email protected] which is newer than yours and the problem still appears.

Effectively I'm using pnp

ubugnu avatar Jul 13 '24 06:07 ubugnu

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.

uigywnkiub avatar Aug 07 '24 13:08 uigywnkiub

For the original issue: Yarn 4.1.1 is not compatible with TypeScript 5.5.

We should probably add a compatibility table to the docs. In the meantime, just upgrade Yarn

For others: You'll most likely see a "Cannot apply hunk" warning during install if you try to install an incompatible version of TypeScript. If you don't and still having problem with TypeScript please open a new issue with reproduction

clemyan avatar Mar 18 '25 14:03 clemyan