File tree Expand file tree Collapse file tree 4 files changed +7
-15
lines changed
Expand file tree Collapse file tree 4 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,9 @@ export const Turbolinks = {
5050 // Returns promise for turbolinks to be ready to render (runs requestAnimationFrame internally)
5151 async _vikeBeforeRender (
5252 visit : Visit | undefined ,
53- errorWhileRendering : unknown ,
5453 pageContextToCache ?: any
5554 ) : Promise < void > {
56- if ( ( ! visit || visit . state === "completed" ) && ! errorWhileRendering ) {
55+ if ( ! visit || visit . state === "completed" ) {
5756 throw new Error (
5857 `Bifrost does not support calling navigate() directly. Use navigate from "@alignable/bifrost" or Turbolinks.visit() instead.`
5958 ) ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { Turbolinks } from "../../lib/turbolinks";
55export default async function bifrostOnAfterRenderClient (
66 pageContext : PageContextClient
77) {
8- if ( ! pageContext . isHydration ) {
8+ if ( ! pageContext . isHydration && ! pageContext . errorWhileRendering ) {
99 await Turbolinks . _vikeAfterRender ( pageContext . _turbolinksVisit , false ) ;
1010 }
1111}
Original file line number Diff line number Diff line change @@ -5,12 +5,9 @@ import { setBodyAttributes } from "../../lib/elementUtils";
55export default async function bifrostOnBeforeRenderClient (
66 pageContext : PageContextClient
77) {
8- if ( ! pageContext . isHydration ) {
8+ if ( ! pageContext . isHydration && ! pageContext . errorWhileRendering ) {
99 pageContext . _shouldEmitBeforeRender = true ;
10- await Turbolinks . _vikeBeforeRender (
11- pageContext . _turbolinksVisit ,
12- pageContext . errorWhileRendering
13- ) ;
10+ await Turbolinks . _vikeBeforeRender ( pageContext . _turbolinksVisit ) ;
1411
1512 // Copy over body attributes because vike-react only handles body on initial render, and we need to reset when coming from wrapped
1613 if ( pageContext . config . bodyAttributes )
Original file line number Diff line number Diff line change @@ -53,13 +53,9 @@ export default async function wrappedOnBeforeRenderClient(
5353 const { head, bodyAttrs } = pageContext . _turbolinksProxy ! ;
5454 pageContext . _shouldEmitBeforeRender = true ;
5555
56- await Turbolinks . _vikeBeforeRender (
57- pageContext . _turbolinksVisit ,
58- pageContext . errorWhileRendering ,
59- {
60- proxyLayoutInfo : pageContext . proxyLayoutInfo ,
61- }
62- ) ;
56+ await Turbolinks . _vikeBeforeRender ( pageContext . _turbolinksVisit , {
57+ proxyLayoutInfo : pageContext . proxyLayoutInfo ,
58+ } ) ;
6359 const { waitForReload, waitForHeadScripts } = mergeHead ( head ! ) ;
6460
6561 // If a full reload is required, wait for it here
You can’t perform that action at this time.
0 commit comments