-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug?]: yarn isn't loading @types packages after upgrading TS to 4.8.3 #4872
Comments
We'll need a reproduction and please always provide one, it makes this easier and faster for everyone.
I tried updating this repo to TypeScript v4.8.3 and |
EDIT: I just checked, and Running into the same issue with Note $ yarn set version stable
➤ YN0000: Retrieving https://repo.yarnpkg.com/3.2.3/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-3.2.3.cjs
➤ YN0000: Done in 0s 246ms
$ yarn init
{
name: 'xxx',
packageManager: 'yarn@3.2.3'
}
$ yarn add --dev typescript
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ typescript@npm:4.8.4 can't be found in the cache and will be fetched from the r
➤ YN0013: │ typescript@patch:typescript@npm%3A4.8.4#~builtin<compat/typescript>::version=4.
➤ YN0013: │ typescript@npm:4.8.4 can't be found in the cache and will be fetched from the r
➤ YN0066: │ typescript@patch:typescript@npm%3A4.8.4#~builtin<compat/typescript>::version=4.8.4&hash=a1c5e5: Cannot apply hunk #7
➤ YN0000: └ Completed in 8s 758ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: Done with warnings in 8s 943ms Consequences: $ yarn add --dev @types/node
-- snip --
$ yarn exec tsc --init
-- snip --
$ cat <<EOF > index.ts
import * as fs from "fs";
console.log(fs.readFileSync("./package.json", "utf-8"));
EOF
$ yarn exec tsc
index.ts:1:21 - error TS2307: Cannot find module 'fs' or its corresponding type declarations.
1 import * as fs from "fs";
~~~~
Found 1 error in index.ts:1 Note: this also reproduces with |
@ezracelli It will be fixed by #4903, if you need the fix right now you can run yarn set version from sources --branch 4903
Not "official" but usually @arcanis or I update the patch then either of us backport and we release it soon after. |
Yeah, I think this issue is different. I've been trying to recreate this in a fresh project, moving one project at a time over from the main monorepo, and I've copied all of the important bits over now, and the new project is still working, and the old project is still failing. The only differences in beyond compare are some slightly newer patch versions on some of the transitive dependencies in the cache folder, and a slightly different |
@ezracelli I had a similar situation, downgrading to On one of my workspaces, I reverted to |
So, I'm going to go ahead and close this as a non-issue. I re-cloned my repo to an entirely fresh checkout, and the branch that I was working in works in the new checkout (but still fails in the old checkout). So it must be something that's just corrupted in the local copy of my repo. It would be nice to understand how that happened, to avoid it in the future (as in, what kind of files might yarn or another library be holding on to that could cause this type of thing), but it doesn't make sense to spend more energy on it. |
For anyone else coming here, for me (Yarn3, pnp, workspaces) upgrading Yarn and its SDKs did the trick. So after upgrading to |
Same seems to happen with Typescript |
Yes, we just released 3.3.0 which should solve this problem. |
Self-service
Describe the bug
This afternoon I upgraded several projects in a monorepo using yarn 3 with pnp, and after upgrading TypeScript from 4.7.4 to 4.8.3, the rollup builds were no longer able to find types for node's
path
module, theprocess
global object, or types forglob
. It's a tiny project, so those are the only types I'm really using. I'm sure if it was a larger project it'd be worse.To reproduce
This is company repo. If you're unable to reproduce, I can try and create a small public repro. Basically just TypeScript 4.8 using node and glob types, and the latest yarn with pnp
Environment
Additional context
Error messages on build, after upgrade:
The text was updated successfully, but these errors were encountered: