diff --git a/resources/js/turbolinks.js b/resources/js/turbolinks.js index 71a8c1ae7..28e0b677c 100644 --- a/resources/js/turbolinks.js +++ b/resources/js/turbolinks.js @@ -3,7 +3,7 @@ import * as Turbo from '@hotwired/turbo' Turbo.config.drive.progressBarDelay = 5 document.addEventListener('turbo:before-visit', function (e) { - if (typeof history.state.turbo === 'undefined') { + if (!history?.state || typeof history.state.turbo === 'undefined') { // Trigger turbo to add the state. Turbo?.navigator?.history?.replace(window.location) }