Open
Description
Hello,
I found an error from running tsgo. I am not exactly sure what file caused it but I believe it's reproducible. it's a large-ish open source project here.
Repro
git clone [email protected]:GMOD/jbrowse-components
cd jbrowse-components
git clone tsgo_error_repro #branch to checkout with tsgo
yarn
yarn tsgo
Environment
running on node 24.1.0, ubuntu 24
"@typescript/native-preview": "^7.0.0-dev.20250612.1",
Log
❯❯❯ y tsgo
yarn run v1.22.22
$ /home/cdiesh/src/jbrowse-components/node_modules/.bin/tsgo
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6f32b2]
goroutine 10700 [running]:
github.com/microsoft/typescript-go/internal/ast.IsBlock(...)
github.com/microsoft/typescript-go/internal/ast/ast.go:3078
github.com/microsoft/typescript-go/internal/printer.(*Printer).emitConciseBody(0xc0fa3d6600?, 0xcea298?)
github.com/microsoft/typescript-go/internal/printer/printer.go:2570 +0x12
github.com/microsoft/typescript-go/internal/printer.(*Printer).emitArrowFunction(0xc0fa3d6600, 0xc0f94497c0)
github.com/microsoft/typescript-go/internal/printer/printer.go:2593 +0x20c
github.com/microsoft/typescript-go/internal/printer.(*Printer).emitExpression(0xc0fa3d6600, 0xc0f94497c0, 0x2)
github.com/microsoft/typescript-go/internal/printer/printer.go:3030 +0x5a9
github.com/microsoft/typescript-go/internal/printer.(*Printer).emitInitializer(0xc0fa3d6600, 0xc0f94497c0, 0x7fc, 0xc0fad32fc0)
github.com/microsoft/typescript-go/internal/printer/printer.go:1480 +0xa6
github.com/microsoft/typescript-go/internal/printer.(*Printer).emitCommonJSExport(0xc0fa3d6600, 0xc0fad32fc0)
github.com/microsoft/typescript-go/internal/printer/printer.go:3760 +0x134
github.com/microsoft/typescript-go/internal/printer.(*Printer).emitStatement(0x76b0b5774248?, 0xc0f4fab860?)
github.com/microsoft/typescript-go/internal/printer/printer.go:3967 +0x46f
github.com/microsoft/typescript-go/internal/printer.(*Printer).emitListItems(0xc0fa3d6600, 0xc00ef0, 0xc0fa3cc508, {0xc0fad50ae0, 0x2, 0x20?}, 0x1, 0x0, {0x0, 0xb08})
github.com/microsoft/typescript-go/internal/printer/printer.go:4676 +0x4b9
github.com/microsoft/typescript-go/internal/printer.(*Printer).emitListRange(0xc0fa3d6600, 0xc00ef0, 0xc0fa3cc508, 0xc0fad358a0, 0x1, 0xaca940?, 0xc00616c788?)
github.com/microsoft/typescript-go/internal/printer/printer.go:4473 +0x395
github.com/microsoft/typescript-go/internal/printer.(*Printer).emitSourceFile(0xc0fa3d6600, 0xc0fa3cc508)
github.com/microsoft/typescript-go/internal/printer/printer.go:4395 +0x208
github.com/microsoft/typescript-go/internal/printer.(*Printer).Write(0xc0fa3d6600, 0xc0fa3cc508, 0xc0f7076fc0?, {0xd04590, 0xc0f4081e30}, 0x1?)
github.com/microsoft/typescript-go/internal/printer/printer.go:4925 +0x100c
github.com/microsoft/typescript-go/internal/compiler.(*emitter).printSourceFile(0xc0f4c7fc20, {0xc0132a8b80, 0x74}, {0x0, 0x0}, 0xc0fa3cc508, 0xc0fa3d6600, 0x0)
github.com/microsoft/typescript-go/internal/compiler/emitter.go:158 +0x289
github.com/microsoft/typescript-go/internal/compiler.(*emitter).emitDeclarationFile(0xc0f4c7fc20, 0xc00616c788, {0xc0132a8b80, 0x74}, {0x0, 0x0})
github.com/microsoft/typescript-go/internal/compiler/emitter.go:127 +0x5c5
github.com/microsoft/typescript-go/internal/compiler.(*emitter).emit(0xc0f4c7fc20)
github.com/microsoft/typescript-go/internal/compiler/emitter.go:43 +0x5d
github.com/microsoft/typescript-go/internal/compiler.(*Program).Emit.func2()
github.com/microsoft/typescript-go/internal/compiler/program.go:762 +0x149
github.com/microsoft/typescript-go/internal/core.(*parallelWorkGroup).Queue.func1()
github.com/microsoft/typescript-go/internal/core/workgroup.go:39 +0x50
created by github.com/microsoft/typescript-go/internal/core.(*parallelWorkGroup).Queue in goroutine 1
github.com/microsoft/typescript-go/internal/core/workgroup.go:37 +0x85
error Command failed with exit code 2.
Maybe related
Saw this issue, somewhat similar error #898