Skip to content

Commit

Permalink
prerender: Wait for the loading state to complete, fix 404
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shesek committed Oct 18, 2024
1 parent 135dce7 commit a4b445b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/run-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function render(pathname, args='', body, locals={}, cb) {

lastState = S

if (S.loading || !S.isReady) {
if (S.view == 'loading' || S.loading > 0) {
if (!seenLoading) {
seenLoading = true
clearTimeout(timeout)
Expand Down

0 comments on commit a4b445b

Please sign in to comment.