Skip to content

panic: bundled: failed to evaluate symlinks: The system cannot find the path specified. [recovered, repanicked] #2375

@xxxxue

Description

@xxxxue

Extension Version

0.20251213.1

VS Code Version

1.106.0

Operating system Version

Windows 10 22H2 (Professional)

Steps to reproduce

  1. Install extensions (TypeScript (Native Preview))
  2. "typescript.experimental.useTsgo": true
  3. Restart vscode
  4. Open TypeScript project

Issue

exe, err = filepath.EvalSymlinks(exe)
if err != nil {
panic(fmt.Sprintf("bundled: failed to evaluate symlinks: %v", err))
}

2025-12-14 02:32:50.202 [error] panic: bundled: failed to evaluate symlinks: The system cannot find the path specified. [recovered, repanicked]
2025-12-14 02:32:50.203 [error] 
2025-12-14 02:32:50.203 [error] goroutine 1 [running]:
2025-12-14 02:32:50.203 [error] github.com/microsoft/typescript-go/internal/bundled.init.OnceValue[...].func8.1.1()
2025-12-14 02:32:50.203 [error] 	sync/oncefunc.go:63 +0x75
2025-12-14 02:32:50.204 [error] panic({0x7ff7d1be6ae0?, 0xc00003a880?})
2025-12-14 02:32:50.204 [error] 	runtime/panic.go:783 +0x132
2025-12-14 02:32:50.204 [error] github.com/microsoft/typescript-go/internal/bundled.init.OnceValue[...].func7.1.1()
2025-12-14 02:32:50.204 [error] 	sync/oncefunc.go:63 +0x75
2025-12-14 02:32:50.205 [error] panic({0x7ff7d1be6ae0?, 0xc00003a880?})
2025-12-14 02:32:50.205 [error] 	runtime/panic.go:783 +0x132
2025-12-14 02:32:50.205 [error] github.com/microsoft/typescript-go/internal/bundled.init.func3()
2025-12-14 02:32:50.205 [error] 	github.com/microsoft/typescript-go/internal/bundled/noembed.go:29 +0x85
2025-12-14 02:32:50.205 [error] github.com/microsoft/typescript-go/internal/bundled.init.OnceValue[...].func7.1()
2025-12-14 02:32:50.205 [error] 	sync/oncefunc.go:66 +0x58
2025-12-14 02:32:50.205 [error] sync.(*Once).doSlow(0x5?, 0xc000035e00?)
2025-12-14 02:32:50.205 [error] 	sync/once.go:78 +0xac
2025-12-14 02:32:50.205 [error] sync.(*Once).Do(0x30?, 0x7ff7d1cfba40?)
2025-12-14 02:32:50.206 [error] 	sync/once.go:69 +0x19
2025-12-14 02:32:50.206 [error] github.com/microsoft/typescript-go/internal/bundled.init.OnceValue[...].func7()
2025-12-14 02:32:50.206 [error] 	sync/oncefunc.go:58 +0x45
2025-12-14 02:32:50.206 [error] github.com/microsoft/typescript-go/internal/bundled.init.func4()
2025-12-14 02:32:50.206 [error] 	github.com/microsoft/typescript-go/internal/bundled/noembed.go:38 +0x51
2025-12-14 02:32:50.206 [error] github.com/microsoft/typescript-go/internal/bundled.init.OnceValue[...].func8.1()
2025-12-14 02:32:50.206 [error] 	sync/oncefunc.go:66 +0x58
2025-12-14 02:32:50.206 [error] sync.(*Once).doSlow(0xc000157ca8?, 0x7ff7d1510f45?)
2025-12-14 02:32:50.206 [error] 	sync/once.go:78 +0xac
2025-12-14 02:32:50.206 [error] sync.(*Once).Do(0xc00003a840?, 0xc000157ca8?)
2025-12-14 02:32:50.206 [error] 	sync/once.go:69 +0x19
2025-12-14 02:32:50.206 [error] github.com/microsoft/typescript-go/internal/bundled.init.OnceValue[...].func8()
2025-12-14 02:32:50.207 [error] 	sync/oncefunc.go:58 +0x45
2025-12-14 02:32:50.207 [error] github.com/microsoft/typescript-go/internal/bundled.LibPath(...)
2025-12-14 02:32:50.207 [error] 	github.com/microsoft/typescript-go/internal/bundled/bundled.go:31
2025-12-14 02:32:50.207 [error] main.runLSP({0xc00006a0a0, 0x1, 0x2})
2025-12-14 02:32:50.208 [error] 	github.com/microsoft/typescript-go/cmd/tsgo/lsp.go:45 +0x2f8
2025-12-14 02:32:50.208 [error] main.runMain()
2025-12-14 02:32:50.208 [error] 	github.com/microsoft/typescript-go/cmd/tsgo/main.go:18 +0xd7
2025-12-14 02:32:50.208 [error] main.main()
2025-12-14 02:32:50.208 [error] 	github.com/microsoft/typescript-go/cmd/tsgo/main.go:10 +0x13
2025-12-14 02:32:50.216 [error] Server process exited with code 2.
2025-12-14 02:32:50.217 [error] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
2025-12-14 02:32:50.218 [error] 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.
2025-12-14 02:32:50.218 [error] typescript.native-preview-lsp client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
2025-12-14 02:32:50.218 [error] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 

I created a go project and tested the following code, got the same error

go 1.25.1

package main

import (
	"fmt"
	"os"
	"path/filepath"
	"sync"
)

func main() {
	println(executableDir())
}

var executableDir = sync.OnceValue(func() string {
	exe, err := os.Executable()
	if err != nil {
		panic(err)
	}
	// ↓↓↓↓
	exe = "C:/Users/admin/.vscode/extensions/typescriptteam.native-preview-0.20251213.1-win32-x64/lib/tsgo.exe"

	exe, err = filepath.EvalSymlinks(exe)
	if err != nil {
		panic(fmt.Sprintf("bundled: failed to evaluate symlinks: %v", err))
	}
	return filepath.Dir(exe)
})

↓ Also got the same error

var executableDir = sync.OnceValue(func() string {
	exe, err := os.Executable()
	if err != nil {
		panic(err)
	}
	// ↓↓↓↓
	println(exe)
	// output: C:\Users\admin\AppData\Local\Temp\go-build4127866348\b001\exe\main.exe

	exe, err = filepath.EvalSymlinks(exe)
	if err != nil {
		panic(fmt.Sprintf("bundled: failed to evaluate symlinks: %v", err))
	}
	return filepath.Dir(exe)
})

go build main.go
main.exe

got the same error

C:\Users\admin\Desktop\demo\main.exe
panic: bundled: failed to evaluate symlinks: The system cannot find the path specified. [recovered, repanicked]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: EditorRelated to the LSP server, editor experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions