Skip to content

Crash with router.invalidate() inside startTransition #7638

Closed

Description

@valerii15298

Which project does this relate to?

Start

Describe the bug

When using router.invalidate() inside startTransition the app crashes. The necessary precondition is that some nested route should error out with showing errorComponent

Complete minimal reproducer

https://github.com/valerii15298/tss-repros/tree/invalidate-transition-crash

Steps to Reproduce the Bug

git clone https://github.com/valerii15298/tss-repros
cd tss-repros
git switch invalidate-transition-crash
pnpm install
pnpm dev

Open the http://localhost:3000/
Click Go to Test link
Click invalidate button
Wait up to 5 seconds
The app crashes with white screen and error:

Error: Rendered more hooks than during the previous render.

Expected behavior

The app should not crash

Screenshots or Videos

No response

Platform

  • Router / Start Version: latest at the time of this issue(look into package json)
  • OS: macOs
  • Browser: any
  • Bundler: Vite
  • Bundler Version: vite@8.0.16 will be updated inside repro package json

Additional context

No response

Activity

  1. valerii15298 commented on Jun 15, 2026

    @valerii15298
    ContributorAuthor

    It took me a while to create this minimal repro. The first time I encountered it with using form actions with react, which I later abandoned.
    First time I crate this discord question and reproduction attached with form actions: https://discord.com/channels/719702312431386674/1478737651116015730

    Related twit: https://x.com/vpetryniak/status/2049533818030145684?s=20

    Since then I abandoned using react form actions, startTransition, router.invalidate and router loaders because of it. But needed one small thing from it and was able to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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