Skip to content

setting rust-analyzer.server.extraEnv.key = null crashes the TS extension #19627

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

Closed
jyn514 opened this issue Apr 19, 2025 · 1 comment · Fixed by #19634
Closed

setting rust-analyzer.server.extraEnv.key = null crashes the TS extension #19627

jyn514 opened this issue Apr 19, 2025 · 1 comment · Fixed by #19634
Labels
A-vscode vscode plugin issues C-bug Category: bug E-has-instructions Issue has some instructions and pointers to code to get started

Comments

@jyn514
Copy link
Member

jyn514 commented Apr 19, 2025

rust-analyzer version: rust-analyzer version: 0.3.2379-standalone (8365cf8 2025-04-13) [/home/jyn/.vscode/extensions/rust-lang.rust-analyzer-0.3.2379-linux-x64/server/rust-analyzer]

rustc version (eg. output of rustc -V): rustc 1.88.0-nightly (78f2104e3 2025-04-16)

editor or extension: VSCode 1.96.2 (fabdb6a30b49f79a7aba0f2ad9df9b399473380f), extension version 0.3.2379

relevant settings:

$ cat .vscode/settings.json
{
    "rust-analyzer.server.extraEnv": {
        "ENV": null
    }
}
2025-04-19 09:18:41.267 [error] Bootstrap error TypeError: Cannot read properties of null (reading 'toString')
	at /home/jyn/.vscode/extensions/rust-lang.rust-analyzer-0.3.2379-linux-x64/out/main.js:48:4821
	at Array.map (<anonymous>)
	at get serverExtraEnv (/home/jyn/.vscode/extensions/rust-lang.rust-analyzer-0.3.2379-linux-x64/out/main.js:48:4784)

found while investigating #19626

@jyn514 jyn514 added the C-bug Category: bug label Apr 19, 2025
@Veykril
Copy link
Member

Veykril commented Apr 19, 2025

Needs a null / undefined check here

typeof v !== "string" ? v.toString() : v,

and corresponding type adjustments

@Veykril Veykril added E-has-instructions Issue has some instructions and pointers to code to get started A-vscode vscode plugin issues labels Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vscode vscode plugin issues C-bug Category: bug E-has-instructions Issue has some instructions and pointers to code to get started
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants