Skip to content

Commit afd2a6b

Browse files
committed
fix: update nitro._prerenderedRoutes
1 parent 0fdad3b commit afd2a6b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

packages/plugin-rsc/examples/react-router/nitro.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ async function prerender(nitro: Nitro, pages: string[]) {
186186
// const cleanPagePath = (prerenderOptions.outputPath || page.path).split(
187187
// /[?#]/,
188188
// )[0]!
189-
const cleanPagePath = page// prerenderOptions.outputPath ||
190-
.path
189+
const cleanPagePath = page.path // prerenderOptions.outputPath ||
191190
.split(/[?#]/)[0]!
192191
// const cleanPagePath = page.path
193192

@@ -220,5 +219,13 @@ async function prerender(nitro: Nitro, pages: string[]) {
220219
})
221220

222221
await fsp.writeFile(filepath, html)
222+
223+
// need to update internal state e.g. for vercel route `overrides`
224+
// https://github.com/nitrojs/nitro/blob/c468de271cff8d56361c3b09ea1071ed545a550f/src/presets/vercel/utils.ts#L117
225+
nitro._prerenderedRoutes ??= []
226+
nitro._prerenderedRoutes.push({
227+
route: page.path,
228+
fileName: filename,
229+
})
223230
}
224231
}

packages/plugin-rsc/examples/react-router/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default defineConfig({
5353
// '/about',
5454
'/about.rsc',
5555
// TODO(react-router): what is this?
56-
'/.manifest?p=%2F&p=%2Fabout',
56+
// '/.manifest?p=%2F&p=%2Fabout',
5757
],
5858
}),
5959
],

0 commit comments

Comments
 (0)