Much of the benefit of vite + http/2 is the ability to rely on cached requests of http/2 -- as in, turning off "disable cache" in the network tools.
However, when an app has to perform 10k network requests on boot, chrome and firefox error with:
I believe this is potentially related to limitations in maybe both the browser and the server
- https://issues.chromium.org/issues/355006326 - the main issue report to Chromium about this use case (large ES module graph)
- Errors we can receive
- net::ERR_FAILED
- net::ERR_HTTP2_PROTOCOL_ERROR
- Hope
-
https://issues.chromium.org/issues/355006326#comment27
Modifying nginx server config to use keepalive_requests 10000; and it solved the problem. Vite issue thread that is still open and related to this vitejs/vite#17499
However, it's unclear whether we can do anything with Vite or Chrome to fix this -- as we are using dev mode, and nginx isn't relevant
-
- Errors we can receive
- I can avoid errors entirely if I throttle the network to "Fast 4G" (this is, however, very slow)
- after this completely, I can un-throttle the network, and all requests succeed
- I can avoid errors by checking "Disable cache" -- this, however, defeats the point of http/2 and vite
Related information:
- rolldown-vite's "Full bundle mode" - https://discord.com/channels/804011606160703521/1416465954816135318/1416763408619143328
- SETTINGS_MAX_CONCURRENT_STREAMS, https://issues.chromium.org/issues/41456843
- Some have this set very low (even as low as 100)
- This hn comment implies that the default is 1000 in Chrome -- however, the vite issue suggests 2000 simultaneous streams. This also suggests that a server must also support higher max concurrent streams.
- General http/2:
- https://github.com/NullVoxPopuli/vite-lots-of-module-repro Lots of modules, if your OS is busy, it'll be slow enough to load correctly. otherwise repros