I had this problem last night while migrating to Yarn v2 and using PnP.
- Make sure that after running
yarn dlx @yarnpkg/sdks vscodethe following folder structure was created inside your.yarndirectory:.yarn/sdks/typescript/lib. - Change your VSCode workspace configuration to add the following:
"typescript.tsdk": ".yarn/sdks/typescript/lib"
I also had another problem with step 1 while using Yarn workspaces in a monorepo, what I had to do was to install typescript, prettier and eslint as devDependencies to the root package (where it usually doesn’t have any dependencies). And on step 2 I changed the path to frontend/.yarn/sdks/typescript/lib