router icon indicating copy to clipboard operation
router copied to clipboard

Docs: SSR streaming example error

Open thgh opened this issue 11 months ago • 5 comments

Which project does this relate to?

Start

Describe the bug

This example crashes the dev server: https://tanstack.com/router/latest/docs/framework/react/examples/basic-ssr-streaming-file-based

Terminal:

> dev
> node server


♻️  Generating routes...
✅ Processed routes in 544ms
Client Server: http://localhost:3000
Rendering:  / ...
TypeError: Cannot read properties of undefined (reading 'url')
    at eval (file:///home/projects/rlmiboakgm.github/node_modules/@tanstack/start/dist/esm/server/createRequestHandler.js:30:33)
    at Module.render (/home/projects/rlmiboakgm.github/src/entry-server.tsx:14:5)
    at eval (file:///home/projects/rlmiboakgm.github/server.js:91:13)

Node.js v18.20.3

It results in a white page in the preview window.

Your Example Website or App

https://tanstack.com/router/latest/docs/framework/react/examples/basic-ssr-streaming-file-based

Steps to Reproduce the Bug or Issue

  1. Open the page
  2. Notice the error in the terminal and the white page

Expected behavior

A working web app

Screenshots or Videos

No response

Platform

  • OS: macos
  • Browser: Chrome

Additional context

No response

thgh avatar Jan 19 '25 12:01 thgh

@tannerlinsley can some one of you please fix your examples? That would help us a lot in debugging our issues. Thanks in advance :)

FelixWiecz avatar Jan 22 '25 08:01 FelixWiecz

Working hard to get them back!

tannerlinsley avatar Jan 22 '25 08:01 tannerlinsley

Probably someone missed to adapt the default handler for streaming: https://github.com/TanStack/router/commit/6c400e160bb76e7ddb39703157d1da3267fe25c1#diff-1b749482f571f052ec4a899848dc0c1d9a9c9b49e950fe6f48b667150004d442R12 ?

FelixWiecz avatar Jan 22 '25 12:01 FelixWiecz

Hey, any updates on this one? Shouldn't the examples be the base to make to whole router usable for everyone?

FelixWiecz avatar Feb 03 '25 07:02 FelixWiecz

Hey @tannerlinsley, do you have working example of streaming ssr? Example from doc is still not working and code here also has some issues ("Invariant failed: Expected to find a dehydrated data on window.__TSR_SSR__.dehydrated... but we did not. Please file an issue!")

GaletinkoV avatar Jun 12 '25 21:06 GaletinkoV

This is resolved as part of #4495. New docs is pending #4527

nlynzaad avatar Jun 26 '25 21:06 nlynzaad