compilerOptions.preserveSymlinks: true
causes ts-plugin(2305)
error in "vue"
module
#13871
-
While attempting various fixes for issues related to pnpm's system link, I noticed that setting I would like to know whether this is an expected behavior or a potential issue? ![]() Here is a reproduction repository for this issue. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @YKDZ! Hey, I cloned your repo to check it out, but I'm not getting the error on my machine. It's almost certainly that Have you tried just removing that line? You probably don't need that option anyway, it's mostly for specific monorepo setups. Out of curiosity, what version of VSCode and the Volar extension you on? And what OS? Maybe thats the difference why I'm not seeing it. |
Beta Was this translation helpful? Give feedback.
Ah, gotcha. My bet is on the OS then. I'm use Linux.
Symlinks can be a bit tricky on Windows, and it looks like the combination of VS Code's file watching + TypeScript's resolver + pnpm's symlink structure just doesn't play nice with
preserveSymlinks: true
on that platform.The official pnpm docs have a section on TypeScript and they explicitly warn against using
preserveSymlinks
. Basically, they say "don't do it" because it completely breaks how TS finds the type definition files. (https://pnpm.io/typescript#do-not-preserve-symlinks)So your original problem was a classic, documented configuration issue. Good that you don't actually need that flag anyway! :)