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

panic: concurrent write to websocket connection when hot reloading changes to a .tsx file. #15

Open
yesudeep opened this issue Dec 22, 2023 · 1 comment

Comments

@yesudeep
Copy link

yesudeep commented Dec 22, 2023

I generated an example using gossr-cli create and had to add the Layout.tsx file manually. However,
when running the application, the hot reloading functionality panics with the following error on
Linux running on an amd64 machine.

zsh❯ go run main.go
8:05PM INF Running go-ssr in development mode
8:05PM DBG Starting type converter
8:05PM DBG Starting hot reload server

   ____    __
  / __/___/ /  ___
 / _// __/ _ \/ _ \
/___/\__/_//_/\___/ v4.11.1
High performance, minimalist Go web framework
https://echo.labstack.com
____________________________________O/_______
                                    O\
8:05PM INF Hot reload websocket running on port 3001
⇨ http server started on [::]:8080
8:05PM INF File changed: /home/yesudeep/code/ofo/frontend/src/components/Counter.tsx, reloading
8:05PM INF File changed: /home/yesudeep/code/ofo/frontend/src/components/Counter.tsx, reloading
panic: concurrent write to websocket connection

goroutine 218 [running]:
github.com/gorilla/websocket.(*messageWriter).flushFrame(0xc001e11ec8, 0x1, {0xc001b76250?, 0x7f7818321230?, 0x7f786279ba68?})
        /home/yesudeep/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:632 +0x4b8
github.com/gorilla/websocket.(*Conn).WriteMessage(0xc0002f06e0, 0xc0001d6360?, {0xc001b76250, 0x6, 0x6})
        /home/yesudeep/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:785 +0x127
github.com/natewong1313/go-react-ssr.(*HotReload).broadcastFileUpdateToClients(0xc0000e4600, {0xc00074c820?, 0x1, 0xc0002840f0?})
        /home/yesudeep/go/pkg/mod/github.com/natewong1313/[email protected]/hotreload.go:159 +0x10f
created by github.com/natewong1313/go-react-ssr.(*HotReload).startWatcher in goroutine 9
        /home/yesudeep/go/pkg/mod/github.com/natewong1313/[email protected]/hotreload.go:124 +0x5d9
exit status 2

@yesudeep yesudeep changed the title panic: concurrent write to websocket connection when hotreloading changes to a .tsx file. panic: concurrent write to websocket connection when hot reloading changes to a .tsx file. Dec 22, 2023
@anduckhmt146
Copy link

same problem

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

2 participants