withastro / language-tools

Language tools for Astro
MIT License
242 stars 46 forks source link

🐛 BUG: Language server fails to launch on latest VSCodium version (1.86.x, flatpak) #806

Closed Mitsunee closed 4 months ago

Mitsunee commented 4 months ago

Describe the Bug

The language server tries to access a directory that does no longer exist in VSCodium 1.86.x (flathub)

Screenshot_20240223_133358

I have tried downgrading VSCodium until I found a version that works again and the directory does seem to exist in version 1.85.2:

Screenshot_20240223_135215

Last known good version of VSCodium:

Version: 1.85.2
Release: 24019
Commit: c8a36a69377856369f139f39ee56dd3838130fbf
Date: 2024-01-19T18:30:44.948Z
Electron: 25.9.7
ElectronBuildId: undefined
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 6.7.4-200.fc39.x86_64

Steps to Reproduce

  1. Install VSCodium 1.86.x
  2. Install Astro Extension
    • potentially need to relaunch codium
  3. Language server fails to launch

Further Notes

Temporary Workarounds (Flatpak)

Rolling back to 1.85.2 does the trick just fine, here's how to do it with flatpak:

sudo flatpak update --commit=52dc04f145cc81fb71351068ebe07d535090d89fbffc4a1dc04b6ac683f4e362 com.vscodium.codium
sudo flatpak mask com.vscodium.codium # this locks the version
# to remove lock after this issue gets resolved:
sudo flatpak mask --remove com.vscodium.codium

Commands do need sudo unless when using --user for a user-installation of the codium flatpak. You can check flatpak remote-info flathub com.vscodium.codium to see what the latest version available on flathub is, the version with the fix is 1.86.2.24054 (which should be available soon)

Princesseuh commented 4 months ago

I presume the extension may want to pull from the Workspace's node_modules instead of the IDE installation to match version with the runtime of the Astro dev server? This may point to this being a different bug and the way I found it to just be a coincidence

We support both, you can change the TypeScript version being used using the command palette (much like you can for TypeScript itself). Supporting both is the best thing to do because the workspace might not have a TypeScript version (ex: an untitled workspace)

I'll look into the issue, wonder where they moved it, ha.

lesar commented 4 months ago

Same problem using fedora 39 codium installed by https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/ using the repository standard: dnf install codium

[Error - 17:21:18] Astro Language Server client: couldn't create connection to server. Message: Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in /usr/share/codium/resources/app/extensions/node_modules/typescript/lib Code: -32603

I try using lunarvim too but get this error

best regards, Leonardo

Princesseuh commented 4 months ago

Seems like it's a bug on VS Codium side https://github.com/VSCodium/vscodium/issues/1809 that has been fixed

Mitsunee commented 4 months ago

Just checked and it seems the vscodium update with the fix for this issue is available on flathub now. Launched into a project with astro, no errors, the node_modules directory seems to be back where it belongs. Thanks for looking into it 👍🏻