Skip to content

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

Open
@ariel-codes

Description

@ariel-codes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions