Skip to content

Conversation

@dajinchu
Copy link
Collaborator

@dajinchu dajinchu commented Jan 28, 2026

Not sure this definitely makes any difference, but reduces any possibility of race condition between navigate calls, if there is any await between navigate() and onBeforeRoute() within Vike implementation.

@dajinchu dajinchu changed the title dc/pass turbolinks visit into navigate Pass Turbolinks Visit Directly into Vike navigate() Jan 28, 2026
if (typeof window !== "undefined" && pageContext.isClientSide) {
const Turbolinks = window.Turbolinks;

let currentVisit = Turbolinks.controller.currentVisit;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Vike does any async between our call to navigate() above and executing onBeforeRoute hook, then it is possible to grab the wrong visit here.

This PR fixes that.

@dajinchu dajinchu merged commit 3e38128 into master Jan 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants