Skip to content
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

Server initialization failed. #813

Closed
MukundSinghRajput opened this issue Jun 26, 2024 · 5 comments
Closed

Server initialization failed. #813

MukundSinghRajput opened this issue Jun 26, 2024 · 5 comments

Comments

@MukundSinghRajput
Copy link

[Error - 7:50:12 PM] Server process exited with code 1.
[Error - 7:50:12 PM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 7:50:12 PM] Connection to server got closed. Server will not be restarted.
[Error - 7:50:12 PM] templ client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097

@heitorfreitasferreira
Copy link

I'm having the same trouble, here is the output of the error in my machine (using wsl2/arch, don't know if the info in relevant)

[Info  - 2:08:05 PM] 2024/06/26 14:08:05 Created View (#1)
	directory=/home/heitor/repos/go-library-manager
	view_type="GoMod"
	root_dir="file:///home/heitor/repos/go-library-manager"
	go_version="go version go1.22.4 linux/amd64"
	build_flags=[]
	env={GOOS:linux GOARCH:amd64 GOCACHE:/home/heitor/.cache/go-build GOMODCACHE:/home/heitor/go/pkg/mod GOPATH:/home/heitor/go GOPRIVATE: GOFLAGS: GO111MODULE: GoVersion:22 GoVersionOutput:go version go1.22.4 linux/amd64
 ExplicitGOWORK: EffectiveGOPACKAGESDRIVER:}
	env_overlay=[]

[Info  - 2:08:06 PM] 2024/06/26 14:08:06 go/packages.Load #1
	view_id="1"
	snapshot=0
	directory=/home/heitor/repos/go-library-manager
	query=[/home/heitor/repos/go-library-manager/... builtin]
	packages=11
	duration=1.096788128s

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x87a880]

goroutine 23 [running]:
github.com/a-h/templ/cmd/templ/lspcmd/proxy.(*Server).CodeAction(0xc00008a4b0, {0xa55290, 0xc0002c43c0}, 0xc00012f4a0)
	/home/heitor/go/pkg/mod/github.com/a-h/templ@v0.2.707/cmd/templ/lspcmd/proxy/server.go:294 +0x480
github.com/a-h/protocol.serverDispatch({0xa55290, 0xc0002c43c0}, {0xa5b340, 0xc00008a4b0}, 0xc000119800, {0xa55568, 0xc000288d00})
	/home/heitor/go/pkg/mod/github.com/a-h/protocol@v0.0.0-20230224160810-b4eec67c1c22/server.go:158 +0x4013
github.com/a-h/protocol.NewServer.ServerHandler.func1({0xa55290, 0xc0002c43c0}, 0xc000119800, {0xa55568, 0xc000288d00})
	/home/heitor/go/pkg/mod/github.com/a-h/protocol@v0.0.0-20230224160810-b4eec67c1c22/server.go:36 +0x7e
github.com/a-h/protocol.Handlers.ReplyHandler.func1({0xa55290, 0xc0002c43c0}, 0xc000280e58, {0xa55568, 0xc000288d00})
	/home/heitor/go/pkg/mod/go.lsp.dev/jsonrpc2@v0.10.0/handler.go:35 +0xc6
github.com/a-h/protocol.Handlers.AsyncHandler.func2.2()
	/home/heitor/go/pkg/mod/go.lsp.dev/jsonrpc2@v0.10.0/handler.go:114 +0x76
created by github.com/a-h/protocol.Handlers.AsyncHandler.func2 in goroutine 11
	/home/heitor/go/pkg/mod/go.lsp.dev/jsonrpc2@v0.10.0/handler.go:112 +0x165
[Error - 2:08:34 PM] Connection to server got closed. Server will not be restarted.
[Error - 2:08:34 PM] Server process exited with code 2.

image

And the coloring work in some files but not others?

@emarifer
Copy link

I have also received that message and, although I don't know if the problem may be related, I fixed it (in vscode) by downgrading the version from gopls@v0.16.0 to gopls@v0.14.0.

@heitorfreitasferreira
Copy link

I have also received that message and, although I don't know if the problem may be related, I fixed it (in vscode) by downgrading the version from gopls@v0.16.0 to gopls@v0.14.0.

Tanks bro, that helped for now!

@joerdav
Copy link
Collaborator

joerdav commented Jun 27, 2024

The next version of templ will solve this issue, so going to close this for now, thanks for raising.

@joerdav joerdav closed this as completed Jun 27, 2024
@a-h
Copy link
Owner

a-h commented Jun 27, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants