inertia icon indicating copy to clipboard operation
inertia copied to clipboard

Router only checks that `window.history.state` isn't empty, breaks when used with other frameworks

Open ariel-codes opened this issue 7 months ago • 1 comments

Versions:

  • @inertiajs/core version: 1.2.0
  • @inertiajs/vue2 version: #.#.#
  • @inertiajs/vue3 version: #.#.#
  • @inertiajs/react version: 1.2.0
  • @inertiajs/svelte version: #.#.#

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.state to any truthy value before initializing Inertia

ariel-codes avatar Jul 11 '24 00:07 ariel-codes