Skip to content

Commit 30cdeb0

Browse files
committed
chore: fix some logic in fallback: blocking forcing and add comments
1 parent 316ca06 commit 30cdeb0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/runtime/src/templates/server.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,16 @@ const getNetlifyNextServer = (NextServer: NextServerType) => {
4646
const manifest = super.getPrerenderManifest()
4747

4848
if (typeof manifest?.dynamicRoutes === 'object') {
49-
// remove the fallback: true routes from the manifest
50-
// because we don't want to prerender them
5149
for (const route of Object.values(manifest.dynamicRoutes)) {
52-
if (route.fallback !== null) {
50+
// 'fallback' property is:
51+
// - a string when fallback: true is used
52+
// - `null` when fallback: blocking is used
53+
// - `false` when fallback: false is used
54+
// `fallback: true` is not working correctly with ODBs
55+
// as we will cache fallback html forever, so
56+
// we are treating those as `fallback: blocking`
57+
// by editing the manifest
58+
if (typeof route.fallback === 'string') {
5359
route.fallback = null
5460
}
5561
}

0 commit comments

Comments
 (0)