graphiql
graphiql copied to clipboard
Code Navigation issue when using PNPM workspaces
Actual Behavior
Hi. I have my project setup as a PNPM workspace and VSCode GraphQL has been working well except for 1 issue - It navigates within node_modules
folder where PNPM has symlinked the file (as part of PNPM workspaces) instead of the actual file itself. I am adding a gif below demonstrating the same:
If you notice, the real fragment file is within sdk/fragments
but it gooes inside node_modules
and gets the same file from the symlinked node_modules
folder.
Expected Behavior
Code navigation navigates to the real graphql file instead.
Specifications
- GraphQL for VSCode Extension Version: v0.3.13
- VSCode Version:
Version: 1.52.0-insider (user setup)
Commit: f4187f22026ff6537f2ca8132ad3209fceb5071f
Date: 2020-12-02T13:21:33.226Z
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.20201
- OS: Ubuntu server 20.04
hmmm, will look into this, this may be baked into vscode though? or perhaps we need a path resolution to ignore symlinks somewhere
I had same problem and turns out problem wasn't with pnpm
at all. Linking was all right the problem was the way vscode was interpreting it.
double-check your tsconfig.json
, tsconfig.base.json
. etc..
you shouldn't have
"preserveSymlinks": true,
according to tsconfig
With this enabled, references to modules and packages (e.g. imports and ///
directives) are all resolved relative to the location of the symbolic link file, rather than relative to the path that the symbolic link resolves to.