Skip to content

Random SSR invariant dehydration errors with bun #3989

Open
@ci

Description

@ci

Which project does this relate to?

Router

Describe the bug

I had some random Invariant failures in

invariant(
window.__TSR_SSR__?.dehydrated,
'Expected to find a dehydrated data on window.__TSR_SSR__.dehydrated... but we did not. Please file an issue!',
)
with a blank page.

I've tried to debug it a bit, unsure exactly why that happens yet - it seemed to re-render an additional time when this crashed.

Here's a fun one: this only seems to happen using bun, and happens on the examples too.

Your Example Website or App

start-basic-react-query

Steps to Reproduce the Bug or Issue

bunx gitpick TanStack/router/tree/main/examples/react/start-basic-react-query repro
cd repro
bun install
SERVER_PRESET=bun bun run build
SERVER_PRESET=bun bun start

now go to http://localhost:3000 with "fast 4g" throttling in the network tab (makes it a bit more consistent for me, not necessary though), refresh a few times with it open

Expected behavior

Shouldn't run into the Invariant issues.

Screenshots or Videos

No response

Platform

OSX locally, Linux (inside Docker) in prod

Additional context

No response

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