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

Vite fails to load modules in Chrome with net:ERR_FAILED error #17499

Open
7 tasks done
CyberAP opened this issue Jun 17, 2024 · 2 comments
Open
7 tasks done

Vite fails to load modules in Chrome with net:ERR_FAILED error #17499

CyberAP opened this issue Jun 17, 2024 · 2 comments

Comments

@CyberAP
Copy link

CyberAP commented Jun 17, 2024

Describe the bug

If you try to load lots of modules at once using Vite the page could fail to load with net:ERR_FAILED code occasionally. This happens probably because JS module requests oversaturate Chrome networking and it fails to fulfil some of the requests. This bug doesn't affect Firefox.

At GitLab we had to engineer our own mitigation for this bug, but it's not fully fixed.

I don't know if the bug is caused only by Chrome, Vite or both. Vite shows no errors in the stdout when this happens.

image
1Screen.Recording.2024-06-17.at.19.23.52.mov

Reproduction

https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/index.md#one-line-installation

Steps to reproduce

This bug is only reproduced when Vite is in dev mode, so the reproduction environment is not that easy to set up. Using GitPod or similar services to setup the environment won't work because you need to have minimal latency with Vite dev server. Stackblitz didn't work for me at the moment because I wasn't able to handle a repo of Gitlab's size.

To fully reproduce it by yourself you'd need:

  1. Install GitLab Development Kit (GDK)
  2. Launch GDK
  3. Go to https://gdk.test:3443/flightjs/Flight/-/merge_requests/4/diffs or any other merge request in GDK
  4. Refresh the page until you see the bug

System Info

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 45.34 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.asdf/installs/nodejs/20.12.2/bin/node
    Yarn: 1.22.19 - ~/.asdf/shims/yarn
    npm: 10.5.0 - ~/.asdf/plugins/nodejs/shims/npm
  npmPackages:
    @vitejs/plugin-vue2: ^2.3.1 => 2.3.1 
    vite: ^5.3.1 => 5.3.1 

Browser:
  Arc: Version 1.47.0 (50866)-RC
  Chromium Engine Version 126.0.6478.36

Used Package Manager

yarn

Logs

No response

Validations

@hulh122
Copy link

hulh122 commented Jul 9, 2024

I meet the same ERROR! :(

Hope some way to fix the error

For me, Can only use disable-cache now

@bpartridge-fn
Copy link

We're also hitting this issue in Chromium-based browsers when loading a page in dev mode that initially requests over 2,000 modules and other static resources. Turning off HTTP caching does work around the problem. I wonder if Chrome is exhausting the number of available file descriptors or some other system resource? If so, probably not much that can be done on the Vite side of things other than documenting the workaround and maybe pressing the Chromium team to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants