Skip to content

SPA mode configuration causes app to hang on loading skeleton with Bun + Vite 7 #5171

@Necmttn

Description

@Necmttn

Description

When using TanStack Start with Bun runtime and Vite 7, having the spa configuration object present (even when commented out internally) causes the application to get stuck showing the loading skeleton and never hydrate properly.

Environment

  • TanStack Start: Latest
  • Vite: 7.1.6
  • Runtime: Bun 1.2.23
  • React: 19.1.1

Configuration that causes the issue

// vite.config.ts
tanstackStart({
    target: "bun",
    customViteReactPlugin: true,
    spa: {
        // enabled: true,
    },
}),

Working configuration

// vite.config.ts
tanstackStart({
    target: "bun",
    customViteReactPlugin: true,
    // spa: {
    //     // enabled: true,
    // },
}),

Symptoms

  • Server starts successfully
  • SSR returns loading skeleton HTML
  • Client connects ("[vite] connected" in console)
  • App remains in "pending" state and never hydrates
  • No JavaScript errors in console
  • Page shows only the animated loading skeleton

Expected behavior

The app should either:

  1. Work correctly with an empty spa: {} configuration object, or
  2. Throw a clear error if the configuration is invalid

Workaround

Completely commenting out the spa configuration object resolves the issue and allows the app to work normally in SSR mode.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions