Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: Go To Definition crashes when moving to a file that is located in a different workspace with npm workspaces in Neovim #984

Open
RogierdeRuijter opened this issue Dec 24, 2024 · 0 comments
Labels
needs triage Issue needs to be triaged

Comments

@RogierdeRuijter
Copy link

RogierdeRuijter commented Dec 24, 2024

Describe the Bug

Using 'Go To Definition' that moves me to a file in a different workspace npm workspace crashes the LSP with the following error message:

image

The logs display the following messages:

[ERROR][2024-12-24 14:10:50] .../vim/lsp/rpc.lua:770 "rpc"
"/Users/r.de.ruijter/.local/share/nvim/mason/bin/astro-ls" "stderr"
"/Users/r.de.ruijter/.local/share/nvim/mason/packages/astro-language-server/node_modules/typescript/lib/typescript.js:140899\n
return !!entry.sourceFile;\n ^\n\nTypeError: Cannot read properties of undefined
(reading 'sourceFile')\n at isDocumentRegistryEntry
(/Users/r.de.ruijter/.local/share/nvim/mason/packages/astro-language-server/node_modules/typescript/lib/typescript.js:140899:18)\n
at getDocumentRegistryEntry
(/Users/r.de.ruijter/.local/share/nvim/mason/packages/astro-language-server/node_modules/typescript/lib/typescript.js:140975:19)\n
at Object.releaseDocumentWithKey
(/Users/r.de.ruijter/.local/share/nvim/mason/packages/astro-language-server/node_modules/typescript/lib/typescript.js:141070:19)\n
at
/Users/r.de.ruijter/.local/share/nvim/mason/packages/astro-language-server/node_modules/typescript/lib/typescript.js:150006:65\n
at forEach
(/Users/r.de.ruijter/.local/share/nvim/mason/packages/astro-language-server/node_modules/typescript/lib/typescript.js:2282:22)\n
at cleanupSemanticCache
(/Users/r.de.ruijter/.local/share/nvim/mason/packages/astro-language-server/node_modules/typescript/lib/typescript.js:150006:7)\n
at Object.dispose
(/Users/r.de.ruijter/.local/share/nvim/mason/packages/astro-language-server/node_modules/typescript/lib/typescript.js:150011:5)\n
at Object.dispose
(/Users/r.de.ruijter/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/node_modules/volar-service-typescript/lib/plugins/semantic.js:219:37)\n
at
/Users/r.de.ruijter/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/node_modules/@volar/language-service/lib/languageService.js:229:77\n
at Array.forEach (<anonymous>)\n\nNode.js v23.3.0\n"
[ERROR][2024-12-24 14:10:50] ...lsp/handlers.lua:623	"Failed to refresh diagnostics"

Steps to Reproduce

I am unable to create a reproduction for this issue, but there is an attempt to reproduce the setup in link below

I have a sense that it happens only in my monorepo setup where there are a large number of Astro components lying around.

Link to Minimal Reproducible Example

https://github.com/RogierdeRuijter/go-to-definition-astro

@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant