berry: [Bug] Go-to definition with ZipFS doesn't work in VSCode 1.48

  • I’d be willing to implement a fix

    I’d have to be given a lot of direction though…

Describe the bug

When jumping to definitions in VSCode 1.48 with the Yarn SDKs and ZipFS extension installed, I get an error similar to this:

Unable to open ‘index.d.ts’: Unable to read file ‘/zip:/Users/me/src/project/.yarn/cache/@types-leaflet-npm-1.5.17-401fcefaf4-a596fb8672.zip/node_modules/@types/leaflet/index.d.ts’ (Error: Unable to resolve non-existing file ‘/zip:/Users/me/src/project/.yarn/cache/@types-leaflet-npm-1.5.17-401fcefaf4-a596fb8672.zip/node_modules/@types/leaflet/index.d.ts’).

The same action works in 1.47.

To Reproduce

I don’t know how to script this, so I made a repo with some instructions:

https://github.com/xandris/zipfs-bug

Environment if relevant (please complete the following information):

  • OS: Mac OS 10.15.6
  • Node: 14.8.0
  • Yarn: 2.1.1

Additional context

VSCode 1.48 appears to generate a path that starts with /zip:, bit if you cause a failure in 1.47, the paths it prints out start with zip:. So maybe the leading slash is the immediate cause?

Right-clicking on a zip file and choosing “mount as directory” doesn’t appear to do anything in either 1.47 or 1.48, or at least I can’t find the effect.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 6
  • Comments: 28 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Correct, it hasn’t been released and those changes aren’t included when built from sources, you can manually copy paste the file from our repo for now https://github.com/yarnpkg/berry/blob/3caf1db2538ad1417a921621d27a2df3cf46baab/.yarn/sdks/typescript/lib/tsserver.js

I tried using yarn berry again today. I gave up after this issue.

Steps I took:

  • Created new repo
  • Follow steps 1-4 on installation docs
  • Realize that everything in my editor was broken (type checking, intellisense, etc.), and Google around to find “Editor SDKs” tab in the “Getting Started” docs (which I ignored in setup because it wasn’t a numbered step).
  • Run yarn dlx @yarnpkg/sdks vscode
  • Get prompted to use local TS version and agree
  • Go to definition still doesn’t work
  • Tried using rm ~/Library/Application\ Support/Code as advertised above which wiped all of my VS Code’s settings, so I had to reload from settings sync
  • Still no dice

Yay. Had to wipe my %AppData%/Code but it seems to be working now. Cheers for the suggestions.