remix-run / remix

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

Application error on throwing response on splat route #9721

Closed safinn closed 4 months ago

safinn commented 4 months ago

Reproduction

https://stackblitz.com/edit/remix-run-remix-fscn1k?file=app%2Froutes%2F%24.tsx

System Info

System:
  OS: macOS 14.5
  CPU: (10) arm64 Apple M1 Pro
  Memory: 31.69 MB / 16.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 22.4.0
  npm: 10.8.1
  pnpm: 9.4.0
Browsers:
  Brave Browser: 126.1.67.123
  Safari: 17.5
npmPackages:
  @remix-run/dev: ^2.10.2 => 2.10.2 
  @remix-run/express: ^2.10.2 => 2.10.2 
  @remix-run/node: ^2.10.2 => 2.10.2 
  @remix-run/react: ^2.10.2 => 2.10.2 
  @remix-run/server-runtime: ^2.10.2 => 2.10.2 
  vite: ^5.3.3 => 5.3.3

Used Package Manager

pnpm

Expected Behavior

No error and for the ErrorBoundary component to be rendered from the splat route when pages that do not exist are attempted to be accessed.

Actual Behavior

Shows an application error when throwing the ResponseStub object from the splat route loader with a status of 404.

jozefmery commented 4 months ago

Throwing a plain response like so: throw new Response(undefined, { status: 404 }); also causes the issue.

brophdawg11 commented 4 months ago

This is resolved by the above PR and will be available in the next release