ElMassimo / ElMassimo/vite_ruby

Vite 8 needs longer timeout waiting on dev server

Open
#616 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
1.6k
Forks
149
Avg merge
5h 13m
Merged PRs (30d)
2

Description

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?

https://github.com/ElMassimo/vite_ruby/blob/3edc67485fd4021072b43ad3a073ffa0fa851ede/vite_ruby/default.vite.json#L9

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.