Skip to content

[Bug]: (v7) Cannot prerender resource routes #12196

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

Closed
k0michi opened this issue Oct 29, 2024 · 7 comments · Fixed by #12200
Closed

[Bug]: (v7) Cannot prerender resource routes #12196

k0michi opened this issue Oct 29, 2024 · 7 comments · Fixed by #12200
Labels

Comments

@k0michi
Copy link

k0michi commented Oct 29, 2024

What version of React Router are you using?

7.0.0-pre.1, 7.0.0-pre.2

Steps to Reproduce

  1. Go to https://stackblitz.com/edit/github-6rufwv
  2. Run pnpm build

Expected Behavior

It should build successfully.

Actual Behavior

It fails with the following message.

Note that node version is irrelevant to this error; I got the same error with node 22.10.0.

~/projects/github-6rufwv
❯ pnpm build
 WARN  Unsupported engine: wanted: {"node":">=20.0.0"} (current: {"node":"v18.20.3","pnpm":"8.15.6"})

> @ build /home/projects/github-6rufwv
> react-router build

vite v5.4.10 building for production...
✓ 41 modules transformed.
Generated an empty chunk: "resource".
build/client/.vite/manifest.json                1.57 kB │ gzip:  0.42 kB
build/client/assets/root-DQHep_n7.css           6.79 kB │ gzip:  2.02 kB
build/client/assets/resource-l0sNRNKZ.js        0.00 kB │ gzip:  0.02 kB
build/client/assets/with-props-CMSwQhCY.js      0.19 kB │ gzip:  0.16 kB
build/client/assets/root-DxNDofi5.js            0.78 kB │ gzip:  0.45 kB
build/client/assets/home-DtVDxzf_.js            3.74 kB │ gzip:  1.67 kB
build/client/assets/index-DAl0xit8.js          99.52 kB │ gzip: 33.13 kB
build/client/assets/entry.client-Do1hcxZM.js  137.13 kB │ gzip: 44.36 kB
✓ built in 1.64s
vite v5.4.10 building SSR bundle for production...
✓ 11 modules transformed.
build/server/.vite/manifest.json                0.23 kB
build/server/assets/server-build-DQHep_n7.css   6.79 kB
build/server/index.js                          10.54 kB
Prerender: Generated build/client/resource.data
The following error is a bug in Remix; please open an issue! https://github.com/remix-run/remix/issues/new
Error: 
    at invariant (file:///home/projects/github-6rufwv/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/lib/server-runtime/headers.ts:27:9)
    at handleResourceRequest (file:///home/projects/github-6rufwv/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/lib/server-runtime/sessions.ts:271:49)
x Build failed in 556ms
[react-router] Prerender: Received a 500 status code from `entry.server.tsx` while prerendering the `/resource/` path.
Unexpected Server Error
    at validatePrerenderedResponse (/home/projects/github-6rufwv/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@react-router/dev/dist/vite/plugin.js:1252:11)
    at prerenderRoute (/home/projects/github-6rufwv/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@react-router/dev/dist/vite/plugin.js:1230:30) {
  code: 'PLUGIN_ERROR',
  plugin: 'react-router',
  hook: 'writeBundle'
}
 ELIFECYCLE  Command failed with exit code 1.
@k0michi k0michi added the bug label Oct 29, 2024
@k0michi
Copy link
Author

k0michi commented Oct 29, 2024

The same error was mentioned in #12181, but it was not solved.

@brophdawg11
Copy link
Contributor

This should be resolved in 7.0.0-pre.3 if you want to give it a shot 👍

Copy link
Contributor

🤖 Hello there,

We just published version 7.0.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!

Copy link
Contributor

🤖 Hello there,

We just published version 6.28.1-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!

Copy link
Contributor

🤖 Hello there,

We just published version 6.28.1 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!

Copy link
Contributor

🤖 Hello there,

We just published version 7.1.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!

Copy link
Contributor

🤖 Hello there,

We just published version 6.28.2-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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants