Since upgrading vite, I was having trouble getting the vite dev server to be recognized by running rails dev server.
Claude suggested it was because recent vite dev server could take longer to start due to more checks at startup, and suggested a fix by increasing devServerConnectTimeout from the generated 0.01 to 0.5.
This indeed worked. In config/vite.json:
"development": {
#...
"devServerConnectTimeout": 0.5
}
Should vite_ruby default be increased to accomodate slower vite dev server startup in recent versions?
|
"devServerConnectTimeout": 0.01, |
Or another change such that there's only a longer timeout in first request or something like that? Or vite rails server side being willing to re-check for vite dev server, instead of permanently caching the "not available" value? It does look like once vite dev server times out once, it won't be used by vite rails again (until process restart).
Not totally sure the optimal solution or if I understand what is going on, but I know vite dev server was mostly not working for me and this change did fix it.
This is a potential frustrating gotcha waiting for someone new getting started with vite ruby, doesn't want to begin with a confusing debugging situation or not even realizing they are getting degraded functionality and performace because dev server isn't being used.
Since upgrading vite, I was having trouble getting the vite dev server to be recognized by running rails dev server.
Claude suggested it was because recent vite dev server could take longer to start due to more checks at startup, and suggested a fix by increasing
devServerConnectTimeoutfrom the generated0.01to0.5.This indeed worked. In config/vite.json:
"development": {
#...
"devServerConnectTimeout": 0.5
}
Should vite_ruby default be increased to accomodate slower vite dev server startup in recent versions?
vite_ruby/vite_ruby/default.vite.json
Line 9 in 3edc674
Or another change such that there's only a longer timeout in first request or something like that? Or vite rails server side being willing to re-check for vite dev server, instead of permanently caching the "not available" value? It does look like once vite dev server times out once, it won't be used by vite rails again (until process restart).
Not totally sure the optimal solution or if I understand what is going on, but I know vite dev server was mostly not working for me and this change did fix it.
This is a potential frustrating gotcha waiting for someone new getting started with vite ruby, doesn't want to begin with a confusing debugging situation or not even realizing they are getting degraded functionality and performace because dev server isn't being used.