remix-run / remix

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

Loader Redirects are inconsistent between Dev / Prod #9456

Closed tallowen closed 1 month ago

tallowen commented 1 month ago

Reproduction

The following is the repository of all the steps below: https://github.com/tallowen/remix-redirect-issue

Steps to reproduce:

  1. npx create-remix@latest
  2. sst init
  3. Add a new routes with loaders in redirects minimal commit
  4. Verify that redirects work locally:

Issue: See redirects on prod build:

System Info

System:
    OS: macOS 13.4.1
    CPU: (8) arm64 Apple M2
    Memory: 121.61 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - /opt/homebrew/opt/node@20/bin/node
    Yarn: 1.22.22 - /opt/homebrew/opt/node@20/bin/yarn
    npm: 10.2.4 - /opt/homebrew/opt/node@20/bin/npm
    pnpm: 9.1.1 - /opt/homebrew/opt/node@20/bin/pnpm
  Browsers:
    Chrome: 124.0.6367.209
    Safari: 16.5.1
  npmPackages:
    @remix-run/dev: ^2.9.2 => 2.9.2
    @remix-run/node: ^2.9.2 => 2.9.2
    @remix-run/react: ^2.9.2 => 2.9.2
    @remix-run/serve: ^2.9.2 => 2.9.2
    vite: ^5.1.0 => 5.2.11

Used Package Manager

npm

Expected Behavior

I expect dev/prod redirects to work in the same way. I expect redirects to not lead to a timeout error.

Actual Behavior

A redirect from a loader is leading to a timeout error.

tallowen commented 1 month ago

Note: I'm more than happy to help gather more information from prod. Unfortunately, this error is manifesting as a timeout error which makes it hard to get a reasonable stack trace. If there are any recommendations for where to throw in some debugs or where it's likely getting stuck, I would appreciate it!

tallowen commented 1 month ago

This appears to be an issue with sst not remix since the express adapter works fine.