TypeScript: auto imports are broken with yarn PNP on Windows
Issue Type: Bug
I haven’t changed my settings at all, but after upgrading to the newest patch my imports and suggestions no longer show which package the import recommendation is coming from. Say I have 2 Configurations and I want to auto-import the one from webpack, it should say which package the current suggestion comes from, and when hitting ENTER it doesn’t import, but rather just finishes the line.

VS Code version: Code 1.46.1 (cd9ea6488829f560dc949a8b2fb789f3cdc05f5d, 2020-06-17T21:13:20.174Z) OS version: Windows_NT x64 10.0.18363
System Info
| Item | Value |
|---|---|
| CPUs | Intel® Core™ i5-8350U CPU @ 1.70GHz (8 x 1896) |
| GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: disabled_off protected_video_decode: enabled rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled viz_display_compositor: enabled_on viz_hit_test_surface_layer: disabled_off_ok webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 7.92GB (1.60GB free) |
| Process Argv | C:\Users\adria\Desktop\Grim\projects\yarnberry-toolkit |
| Screen Reader | no |
| VM | 0% |
Extensions (30)
| Extension | Author (truncated) | Version |
|---|---|---|
| better-comments | aar | 2.0.5 |
| vscode-zipfs | arc | 2.0.0 |
| github-markdown-preview | bie | 0.0.2 |
| markdown-checkbox | bie | 0.1.3 |
| markdown-emoji | bie | 0.0.9 |
| markdown-preview-github-styles | bie | 0.1.6 |
| markdown-yaml-preamble | bie | 0.0.4 |
| vscode-eslint | dba | 2.1.5 |
| javascript-ejs-support | Dig | 1.3.1 |
| gitlens | eam | 10.2.2 |
| vsc-material-theme | Equ | 32.8.0 |
| vsc-material-theme-icons | equ | 1.1.4 |
| prettier-vscode | esb | 5.1.0 |
| vscode-systemd-support | han | 0.1.1 |
| vscode-docker | ms- | 1.3.1 |
| vscode-kubernetes-tools | ms- | 1.2.1 |
| remote-containers | ms- | 0.122.1 |
| remote-ssh | ms- | 0.51.0 |
| remote-ssh-edit | ms- | 0.51.0 |
| remote-wsl | ms- | 0.44.4 |
| vscode-remote-extensionpack | ms- | 0.20.0 |
| vscode-markdown-notebook | ms- | 0.0.7 |
| debugger-for-chrome | msj | 4.12.8 |
| env-cmd-file-syntax | Nix | 0.1.2 |
| material-icon-theme | PKi | 4.2.0 |
| vscode-xml | red | 0.12.0 |
| vscode-yaml | red | 0.8.0 |
| code-spell-checker | str | 1.9.0 |
| vscodeintellicode | Vis | 1.2.8 |
| vscode-nginx | wil | 0.7.2 |
(1 theme extensions excluded)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 23 (8 by maintainers)
https://github.com/thegrimsilence/yarnberry-toolkit uses Yarn 2’s Zero-Install so cloning that will give you a direct state of my own local repo since I commit frequently.
And yeah Yarn 2 has you install
@yarnpkg/pnpifyand runyarn pnpify --sdkto auto-configure every supported sdk, including typescript. Basically, it updates your local settings and installs a local.yarn/cache/sdks/typescriptwhich hosts a custom TS Server and binaries. It’s then added into your.vscode/settings.jsonto point to that server.Thanks for investigating! This is now fixed in https://github.com/yarnpkg/berry/pull/1534
Thank you for your help! I’ll take this over to yarnpkg/berry and let them know the details so they can fix it.
I’ll try to give a try on Windows to see if that makes a difference.
Using the Nightly wouldn’t work since Yarn 2 uses Plug’n’Play and a virtual filesystem which uses a custom version of the latest TypeScript release. Effectively pointless in this scenario unfortunately.