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

Open
remorses opened this issue Jan 29, 2025 · 0 comments
Labels

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant