remix-run / remix

Build Better Websites. Create modern, resilient user experiences with web fundamentals.
https://remix.run
MIT License
30.07k stars 2.54k forks source link

[Single Fetch] async data timeouts after 5 seconds #10229

Open Aleuck opened 1 week ago

Aleuck commented 1 week ago

Reproduction

  1. Set ABORT_DELAY to longer than 5 seconds (I used 120 seconds);
  2. Create a loader that returns a promise that takes more than 5 seconds to resolve (I used 5.5 seconds); and
  3. Test with and without Single Fetch.

Repository with reproduction below:

🚫 Timeout with SingleFetch - branch: main

✅ Works without SingleFetch - branch: working-no-single-fetch

System Info

System:
    OS: macOS 14.7
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 635.59 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.asdf/installs/nodejs/20.12.2/bin/node
    Yarn: 1.22.22 - ~/.asdf/installs/nodejs/20.12.2/bin/yarn
    npm: 10.9.0 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 9.10.0 - ~/.asdf/installs/nodejs/20.12.2/bin/pnpm
  Browsers:
    Chrome: 130.0.6723.117
    Safari: 18.0.1
  npmPackages:
    @remix-run/dev: ^2.14.0 => 2.14.0
    @remix-run/node: ^2.14.0 => 2.14.0
    @remix-run/react: ^2.14.0 => 2.14.0
    @remix-run/serve: ^2.14.0 => 2.14.0
    vite: ^5.1.0 => 5.4.11

Used Package Manager

npm

Expected Behavior

Request succeeds in both examples

Actual Behavior

Request succeeds with single fetch disabled but timeouts when it is enabled.

syaraf-az commented 1 week ago

I think you missed this docs:- Single Fetch: Streaming Timeout

I encountered the same issues previously where the streaming is timed out in production but not on local environment (since the promise resolve quite fast compared to production) and it took me a while to find this section that explain that there is seperate timeout setting for streaming data.