Closed RayGuo-ergou closed 1 month ago
This depends on whether the module is located in the top directory of node_modules
.
When using npm, both definitions are valid. But when using pnpm, the top directory of node_modules
only contains vue
and not @vue/runtime-core
, so declare module '@vue/runtime-core'
is invalid.
This is a solution to a different but related issue: https://github.com/vuejs/language-tools/issues/4170#issuecomment-2025528945
that makes sense, thank you!
I found this issue when working with a project uses element-plus, they use
@vue/runtime-core
to declare global components. I did some research and seems vue document also usesvue
now ( I remembered before prefer@vue/runtime-core
?)e.g. for code
minimal reproduction: https://github.com/RayGuo-ergou/volar_reproduction_global_component_ts