Skip to content
Source
Sign inSign up
TanStack/router

chore(examples): Update Clerk server handler usage #5026

Mergedwobsoriano(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/5026/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Showing 3 changed files with 11 additions and 7 deletions.

x
0 of 3 viewed, 3 left
1 addition and 1 deletionexamples/react/start-clerk-basic/package.jsonModified
View file
@@ -9,7 +9,7 @@
"start": "vite start"
},
"dependencies": {
- "@clerk/tanstack-react-start": "^0.19.0",
+ "@clerk/tanstack-react-start": "^0.23.0",
Thread on line 12

💡 Verification agent

🧩 Analysis chain

Version bump aligns with the new server handler pattern; verify peer deps.

The upgrade to @clerk/tanstack-react-start ^0.23.0 matches the server refactor in src/server.ts. Please verify that peer dependency ranges for React, @tanstack/react-start, and router packages are satisfied after the bump, and that the lockfile is updated.

Run from the repo root to surface any peer dep or type issues:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check for unresolved peer deps and version mismatches
pnpm -w install

# Inspect the example app deps and hoisting results
pnpm -F tanstack-start-example-clerk-basic ls @clerk/tanstack-react-start @tanstack/react-start react react-dom

# Typecheck the example to ensure the new handler API is satisfied
pnpm -F tanstack-start-example-clerk-basic run build

Length of output: 3933


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Print the example's package.json to verify dependencies
sed -n '1,200p' examples/react/start-clerk-basic/package.json

echo "----"

# Print the example's Vite config to inspect imports
sed -n '1,200p' examples/react/start-clerk-basic/vite.config.ts

Length of output: 1323


#!/bin/bash
set -euo pipefail

# Search for the Vite plugin entry in the react-start package source
echo "Searching for 'plugin/vite' references:"
rg -n "plugin/vite" -C2 packages/react-start

echo
# List files under the plugin directory, if it exists
echo "Listing plugin directory contents (if present):"
if [ -d "packages/react-start/plugin/vite" ]; then
  find packages/react-start/plugin/vite -maxdepth 2 -type f -print
else
  echo "packages/react-start/plugin/vite directory not found"
fi

#!/usr/bin/env bash
set -euo pipefail

echo "Listing 'packages/react-start/plugin' directory:"
if [ -d "packages/react-start/plugin" ]; then
  find packages/react-start/plugin -maxdepth 2 -type f -print
else
  echo "  packages/react-start/plugin directory not found"
fi

echo
echo "Searching for 'plugin/vite' references in packages/react-start:"
rg -n "plugin/vite" -C2 packages/react-start || echo "  No 'plugin/vite' references found"

echo
echo "Searching for 'tanstackStart' export in packages/react-start:"
rg -n "export .*tanstackStart" -C3 packages/react-start || echo "  No 'tanstackStart' export found"

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Directory structure under packages/react-start (depth=2):"
find packages/react-start -maxdepth 2 -type d

echo
echo "Contents of plugin/vite directory if it exists:"
if [ -d "packages/react-start/plugin/vite" ]; then
  find packages/react-start/plugin/vite -maxdepth 2 -type f
else
  echo "packages/react-start/plugin/vite not found"
fi

echo
echo "Searching for tanstackStart export in react-start sources:"
rg -n "export .*tanstackStart" -C3 packages/react-start || echo "No tanstackStart export found"

Length of output: 754


Critical: Example build broken by invalid Vite plugin import

Peer dependencies (React ^19.0.0, @tanstack/react-start ^1.131.28, router packages ^1.131.28) are correctly satisfied and the lockfile is up-to-date, but the example fails to build due to a missing plugin entrypoint.

Please address the following before merging:

  • examples/react/start-clerk-basic/vite.config.ts The line
    import { tanstackStart } from '@tanstack/react-start/plugin/vite'
    errors at build time because @tanstack/react-start does not export a plugin/vite path.
  • Verify and correct the Vite plugin entrypoint in the @tanstack/react-start package (or adjust the import to the actual plugin location).
  • After fixing the import, confirm:
    • pnpm -w install completes with no unresolved peers
    • pnpm -F tanstack-start-example-clerk-basic run build succeeds without errors
"@tanstack/react-router": "^1.131.36",
"@tanstack/react-router-devtools": "^1.131.36",
"@tanstack/react-start": "^1.131.36",
10 additions and 6 deletionsexamples/react/start-clerk-basic/src/server.tsModified
View file
@@ -1,14 +1,18 @@
import {
createStartHandler,
defaultStreamHandler,
+ defineHandlerCallback,