Open djkz opened 7 years ago
Interesting, my Rails server doesn't crash on that error, so I didn't bother handling it.
You can see here where we try to start a Websocket server:
https://github.com/rmosolgo/react-rails-hot-loader/blob/master/lib/hot_loader/server.rb#L70
If the server is already running, :boom:! I guess we should either check for the server ahead of time or handle that error more gracefully.
I added another rescue around that block, but I'm not sure a good way to write a test for it, so I'm not creating a pull request.
We can close this issue and add the fix for it if anyone else has that problem.
Yeah, it's so hard to test that part of this thing!! Did you push the change to GitHub? If you're able to link to it from here, it might help someone else, or I might PR it anyways :)
My changes are in here: https://github.com/djkz/react-rails-hot-loader/blob/master/lib/hot_loader/server.rb
I am experiencing the same issue as well. The server just crashes with the same error message.
I also had this problem and @djkz solution seems to have fixed it. Should we submit a PR?
the @djkz solution fixed bug in ruby 2.5.1 (There wasn't the error in using version 0.7.0 and ruby 2.4.4)
Happens sometimes when hard reloading jasmine-rails specs page, haven't been able to figure out what causes it exactly: