Skip to content

Commit 5f5c9a0

Browse files
authored
ensure fetchServerResponse is a valid record when stored in router cache (vercel#55690)
Since these values are inserted into the cache and read with `readRecordValue`, they need to have a `status` property otherwise it'll be re-thrown in `navigate-reducer`. Investigating if this resolves an issue where under certain circumstances navigations get stuck suspending. Closes NEXT-1643
1 parent b811240 commit 5f5c9a0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,14 @@ export function navigateReducer(
319319
treePatch,
320320
// eslint-disable-next-line no-loop-func
321321
() =>
322-
fetchServerResponse(url, currentTree, state.nextUrl, state.buildId)
322+
createRecordFromThenable(
323+
fetchServerResponse(
324+
url,
325+
currentTree,
326+
state.nextUrl,
327+
state.buildId
328+
)
329+
)
323330
)
324331
}
325332

0 commit comments

Comments
 (0)