-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Fix usage of prerender
option with serverBundles
#13082
Conversation
🦋 Changeset detectedLatest commit: fd972c0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
); | ||
let matches = matchRoutes(buildRoutes, `/${path}/`.replace(/^\/\/+/, "/")); | ||
if (!matches) { | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's valid for an individual server bundle not to contain a matching route. Instead, we now perform validation earlier as a separate step, checking the routes coming from react-router.config.ts
which contains everything, not just the potential subset in this server build.
…d-route-typegen * upstream/dev: (65 commits) Generate types for `virtual:react-router/server-build` (remix-run#13152) Add support for client context and middleware (unstable) (remix-run#12941) Add playground for `vite-plugin-cloudflare` (remix-run#13151) do not typegen params for layout routes with a corresponding index (remix-run#13131) (remix-run#13140) Fix types for `loaderData` and `actionData` that contain `Record`s (remix-run#13139) chore: format chore(dev): remove unused dependencies (remix-run#13134) Remove unused Vite file system watcher (remix-run#13133) Remove stale changesets cherry-picked into release-next for 7.2.0 Fix custom SSR build input with `serverBundles` (remix-run#13107) Skip resource route flow in dev mode when SPA mode is enabled (remix-run#13113) chore: format Add integration test for `vite-plugin-cloudflare` (remix-run#13099) Fix custom client `build.rollupOptions.output.entryFileNames` (remix-run#13098) Detect lazy route discovery manifest version mismatches and trigger reloads (remix-run#13061) Fix critical CSS with custom `Vite.DevEnvironment` (remix-run#13066) Fix usage of `prerender` option with `serverBundles` (remix-run#13082) Fix support for custom `build.assetsDir` (remix-run#13077) Add changeset for remix-run#13064 Only import the root route when SSRing SPA mode's index.html (remix-run#13023) ...
🤖 Hello there, We just published version Thanks! |
Fixes #13069.
Since the server build virtual module now includes a query string when using the
serverBundles
option (e.g.virtual:react-router/server-build?route-ids=home,about
), we need to ensure that we factor this into any logic that tries to find this virtual module in the Vite manifest.Note that this issue actually highlighted a previously hidden issue where the build would have broken if you generate than 1 server bundle when using the
prerender
option. This is now also handled correctly.