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

Routes that only export action fail with Prerender: Received a 400 status code from entry.server.tsx while prerendering the /path #12904

Closed
remorses opened this issue Jan 29, 2025 · 2 comments · Fixed by #13004
Labels
awaiting release This issue have been fixed and will be released soon bug

Comments

@remorses
Copy link

remorses commented Jan 29, 2025

I'm using React Router as a...

framework

Reproduction

https://stackblitz.com/edit/stackblitz-webcontainer-api-starter-54oaxcde?file=app%2Froutes%2Fapi%2Fpokemon.ts

Run pnpm build, react-router fails with [react-router] Prerender: Received a 400 status code from entry.server.tsxwhile prerendering the/api/pokemon/ path.

System Info

System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M2 Pro
    Memory: 103.44 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.13.0 - ~/.local/share/pnpm/node
    Yarn: 1.22.22 - ~/.local/share/pnpm/yarn
    npm: 10.9.2 - ~/.local/share/pnpm/npm
    pnpm: 9.14.4 - ~/.local/share/pnpm/pnpm
    bun: 1.2.1 - ~/.bun/bin/bun
  Browsers:
    Chrome: 132.0.6834.111
    Safari: 18.2
  npmPackages:
    @react-router/dev: ^7.0.0 => 7.1.3 
    @react-router/fs-routes: ^7.1.3 => 7.1.3 
    @react-router/node: ^7.0.0 => 7.1.3 
    @react-router/serve: ^7.0.0 => 7.1.3 
    react-router: ^7.1.3 => 7.1.3 
    vite: ^5.4.11 => 5.4.14

Used Package Manager

npm

Expected Behavior

Do not prerender resource routes

Actual Behavior

react-router tries to prerender a resource route without a loader

@remorses remorses added the bug label Jan 29, 2025
@timdorr timdorr changed the title Routes that only export action fail with Prerender: Received a 400 status code from entry.server.tsx while prerendering the /path Routes that only export action fail with Prerender: Received a 400 status code from entry.server.tsx while prerendering the /path Jan 30, 2025
@brophdawg11 brophdawg11 linked a pull request Feb 11, 2025 that will close this issue
@brophdawg11
Copy link
Contributor

This is fixed by #13004 and will be available in the next release

@brophdawg11 brophdawg11 added the awaiting release This issue have been fixed and will be released soon label Feb 12, 2025
Copy link
Contributor

🤖 Hello there,

We just published version 7.2.0-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting release This issue have been fixed and will be released soon bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants