Skip to content

Commit a4b445b

Browse files
committed
prerender: Wait for the loading state to complete, fix 404
Prior to this fix, `render()` preemptively considered the app rendering to be final, before completing the transition out of the loading state entirely. This resulted in notFound pages not being identified as such, returning them with a 200 OK status code instead of a 404 Not Found.
1 parent 135dce7 commit a4b445b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

client/src/run-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default function render(pathname, args='', body, locals={}, cb) {
4646

4747
lastState = S
4848

49-
if (S.loading || !S.isReady) {
49+
if (S.view == 'loading' || S.loading > 0) {
5050
if (!seenLoading) {
5151
seenLoading = true
5252
clearTimeout(timeout)

0 commit comments

Comments
 (0)