TanStack / TanStack/router

Tanstack Start Supabase Auth documentation is broken

Open
#3,831 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.1k
Forks
1.9k
Avg merge
1d 20h
Merged PRs (30d)
143

Description

Which project does this relate to?

Router

Describe the bug
Which project does this relate to?

Start

Describe the bug

This Supabase Auth + Tanstack start is currently half broken.
There seems to be two major problems:

  1. In the fetchUser (__root.tsx) server function, it is returned directly data.user that cointains non-serializable values. Here it's sufficient to no return the entire object
  2. When the page loads the getSupabaseServerClient function causes an hydration error

Additionally

  1. In __root.tsx getSupabaseServerClient does not need to be awaited
Your Example Website or App

https://tanstack.com/start/latest/docs/framework/react/examples/start-supabase-basic

Steps to Reproduce the Bug or Issue
  1. Go to the example site page
  2. Open it with code sandbox
  3. Open the console and reload the page
Expected behavior

There should not be any errors with tsc when cloning the template and there should not be an hydration error when the page loads

Screenshots or Videos

No response

Platform
  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the start-supabase-basic example linked in the issue and inspect __root.tsx, especially fetchUser and getSupabaseServerClient. Clone the template, run tsc, then reload the example while watching the console. Done means the type-check passes and the page loads without hydration or serialization errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, supabase, typescript
Domain
authentication, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.