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

[🐞] All bundles get prefetched with full priority in PrefetchServiceWorker resulting in error ERR_INSUFFICIENT_RESOURCES #6397

Closed
DustinJSilk opened this issue May 26, 2024 · 5 comments · Fixed by #6582
Assignees
Labels
STATUS-2: missing info Incomplete issue/pr template or missing important information TYPE: bug Something isn't working

Comments

@DustinJSilk
Copy link
Contributor

DustinJSilk commented May 26, 2024

Which component is affected?

Qwik Runtime

Describe the bug

When using the PrefetchServiceWorker, the service worker prefetches all bundles with full priority. This results in all requests running in parallel without being throttled by $maxPrefetchRequests$.

In an app with more than ~600 bundles, many of the prefetch requests will throw an error Failed to fetch with (failed)net::ERR_INSUFFICIENT_RESOURCES

Reproduction

https://github.com/DustinJSilk/qwik-prefetch-priority

Steps to reproduce

Clone the reproduction url and run these commands:

$ ./generate.sh

$ pnpm i

$ pnpm build

Preview the app:

$ pnpm preview

Then in chrome

  • Clear the application site data
  • Refresh the page (witness no prefetching, might be another issue?)
  • Refresh the page again (witness network errors (failed)net::ERR_INSUFFICIENT_RESOURCES and console errors)
    • If you don't see network errors, try increasing the number of pages generated in ./generate.sh

System Info

System:
    OS: macOS 14.4.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 474.85 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
    pnpm: 9.0.5 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 125.0.6422.77
    Safari: 17.4.1
  npmPackages:
    @builder.io/qwik: github:QwikDev/qwik-build#55dc8da599c585a880561fe8db9dd488c043eb1c => 1.5.5-dev20240523064535 
    @builder.io/qwik-city: github:QwikDev/qwik-city-build#9306818ac6318b73b2d7b597a9e9512c2f024bc8 => 1.5.5-dev20240523065036 
    typescript: 5.4.5 => 5.4.5 
    undici: * => 6.18.1 
    vite: ^5.2.10 => 5.2.11

Additional Information

No response

@DustinJSilk DustinJSilk added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels May 26, 2024
@thejackshelton thejackshelton moved this to Backlog in Qwik Development May 28, 2024
@shairez shairez added P3: important STATUS-2: team is working on this Scheduled for work by the core team and removed STATUS-1: needs triage New issue which needs to be triaged labels Jun 4, 2024
@shairez shairez moved this from Backlog to Upcoming in Qwik Development Jun 4, 2024
@gioboa gioboa linked a pull request Jun 20, 2024 that will close this issue
@gioboa
Copy link
Member

gioboa commented Jun 20, 2024

Hi, I tested your repo with #6582 and it's working fine with no errors.

image

Thanks for your report.

@PatrickJS
Copy link
Member

I'm going to close this unless we can reproduce it

@github-project-automation github-project-automation bot moved this from Upcoming to Done in Qwik Development Jun 20, 2024
@wmertens
Copy link
Member

@gioboa did you test it on localhost or a server?

@gioboa
Copy link
Member

gioboa commented Jun 20, 2024

Localhost

@shairez shairez added STATUS-2: missing info Incomplete issue/pr template or missing important information and removed STATUS-2: team is working on this Scheduled for work by the core team labels Jun 25, 2024
Copy link
Contributor

Hello @DustinJSilk. Please provide the missing information requested above.
Issues marked with STATUS-2: missing info will be automatically closed if they have no activity within 14 days.
Thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-2: missing info Incomplete issue/pr template or missing important information TYPE: bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants