inertia
inertia copied to clipboard
Router only checks that `window.history.state` isn't empty, breaks when used with other frameworks
Versions:
@inertiajs/coreversion: 1.2.0@inertiajs/vue2version: #.#.#@inertiajs/vue3version: #.#.#@inertiajs/reactversion: 1.2.0@inertiajs/svelteversion: #.#.#
Describe the problem:
When navigating back/forward from pages, the router only checks that window.history.state is not empty, but this can conflict with other navigation frameworks (in my case Turbo/Hotwire, which uses window.history.state.turbo). This in turn leads to the resolve function passed to createInertiaApp being called with an undefined arg.
Steps to reproduce:
- Set
window.history.stateto any truthy value before initializing Inertia