Closed
Description
As titled, the following:
import type Config from "./abc.json"
declare const config: typeof Config
Crash the typescript.native-preview-lsp server inside VSCode, while running tsgo --noEmit
from @typescript/native-preview
work completely fine.
Output:
panic: Unhandled case in Node.Expression
goroutine 25 [running]:
github.com/microsoft/typescript-go/internal/ast.(*Node).Expression(0x67?)
github.com/microsoft/typescript-go/internal/ast/ast.go:369 +0x70e
github.com/microsoft/typescript-go/internal/checker.(*Checker).getTypeOfVariableOrParameterOrPropertyWorker(0xc001093008, 0xc000d25810)
github.com/microsoft/typescript-go/internal/checker/checker.go:15284 +0x173
github.com/microsoft/typescript-go/internal/checker.(*Checker).getTypeOfVariableOrParameterOrProperty(0xc001093008, 0xc000d25810)
github.com/microsoft/typescript-go/internal/checker/checker.go:15231 +0x4d
github.com/microsoft/typescript-go/internal/checker.(*Checker).getTypeOfSymbol(0xc000380010?, 0xa?)
github.com/microsoft/typescript-go/internal/checker/checker.go:15191 +0xa6
github.com/microsoft/typescript-go/internal/checker.(*Checker).resolveExportByName(0xc001093008, 0xc000d257a0, {0xac8f82, 0x7}, 0xc00038e000, 0x0)
github.com/microsoft/typescript-go/internal/checker/checker.go:13792 +0x65
github.com/microsoft/typescript-go/internal/checker.(*Checker).getTargetOfModuleDefault(0xc001093008, 0xc000d257a0, 0xc00038e000, 0x0)
github.com/microsoft/typescript-go/internal/checker/checker.go:13722 +0x90
github.com/microsoft/typescript-go/internal/checker.(*Checker).getTargetOfImportClause(0xc001093008, 0xc00038e000, 0x0)
github.com/microsoft/typescript-go/internal/checker/checker.go:13712 +0xa5
github.com/microsoft/typescript-go/internal/checker.(*Checker).getTargetOfAliasDeclaration(0xc0010936a8?, 0xbd3d40?, 0xb0?)
github.com/microsoft/typescript-go/internal/checker/checker.go:14503 +0xbb
github.com/microsoft/typescript-go/internal/checker.(*Checker).resolveAlias(0xc001093008, 0xc000dc85b0)
github.com/microsoft/typescript-go/internal/checker/checker.go:14987 +0x145
github.com/microsoft/typescript-go/internal/checker.(*Checker).checkAliasSymbol(0xc001093008, 0xc00038e000)
github.com/microsoft/typescript-go/internal/checker/checker.go:6304 +0x4a
github.com/microsoft/typescript-go/internal/checker.(*Checker).checkImportBinding(0xc001093008, 0xc00038e000)
github.com/microsoft/typescript-go/internal/checker/checker.go:5030 +0x4b
github.com/microsoft/typescript-go/internal/checker.(*Checker).checkImportDeclaration(0xc001093008, 0xc00038e060)
github.com/microsoft/typescript-go/internal/checker/checker.go:4957 +0x179
github.com/microsoft/typescript-go/internal/checker.(*Checker).checkSourceElementWorker(0xc001093008, 0xc00038e060)
github.com/microsoft/typescript-go/internal/checker/checker.go:2225 +0x3a5
github.com/microsoft/typescript-go/internal/checker.(*Checker).checkSourceElement(0xc001093008, 0xc001b53200?)
github.com/microsoft/typescript-go/internal/checker/checker.go:2107 +0x4e
github.com/microsoft/typescript-go/internal/checker.(*Checker).checkSourceElements(0xc001093008, {0xc000398000, 0x2, 0xc001b120c0?})
github.com/microsoft/typescript-go/internal/checker/checker.go:2098 +0x2d
github.com/microsoft/typescript-go/internal/checker.(*Checker).checkSourceFile(0xc001093008, {0xbcdf50, 0xc001b14000}, 0xc00039a008)
github.com/microsoft/typescript-go/internal/checker/checker.go:2070 +0x11c
github.com/microsoft/typescript-go/internal/checker.(*Checker).CheckSourceFile(0xc001093008, {0xbcdf50, 0xc001b14000}, 0xc00039a008)
github.com/microsoft/typescript-go/internal/checker/checker.go:2059 +0x51
github.com/microsoft/typescript-go/internal/checker.(*Checker).GetDiagnostics(0xc001093008, {0xbcdf50?, 0xc001b14000?}, 0xc00039a008)
github.com/microsoft/typescript-go/internal/checker/checker.go:13158 +0x5e
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).GetDocumentDiagnostics(0xc001b12090, {0xbcdf50, 0xc001b14000}, {0xc00001c680?, 0x5bb35f?})
github.com/microsoft/typescript-go/internal/ls/diagnostics.go:23 +0x13e
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleDocumentDiagnostic(0xc000133ba0, {0xbcdf50, 0xc001b14000}, 0xc0002c04b0)
github.com/microsoft/typescript-go/internal/lsp/server.go:517 +0xc6
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleRequestOrNotification(0x868ff2?, {0xbcdf50?, 0xc001b14000?}, 0xc000da6848?)
github.com/microsoft/typescript-go/internal/lsp/server.go:397 +0x13c
github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1()
github.com/microsoft/typescript-go/internal/lsp/server.go:282 +0x3a
created by github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop in goroutine 7
github.com/microsoft/typescript-go/internal/lsp/server.go:300 +0x82a
[Error - 10:04:42 PM] Server process exited with code 2.
[Error - 10:04:42 PM] The typescript.native-preview-lsp server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
theoludwig commentedon May 22, 2025
Is it too early to open issue about VSCode LSP? As you consider it still a prototype, sorry, if it creates useless noise, feel free to close it then, if it's not relevant yet.
(was not too sure, because in the README, it says "prototype: proof-of-concept only; do not log bugs")
jakebailey commentedon May 22, 2025
It's not, no. Thanks for the issue.
shawngustaw commentedon May 23, 2025
I'm also seeing a similar error in a NextJS project. Happy to provide more details if needed!
mustafa-hanif commentedon May 30, 2025
Same for me, the only hint i can give in a nextjs project, with
next-intl/server
library, it crashes with the above errorahejlsberg commentedon Jun 16, 2025
This appears to have been fixed. Closing.