Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Nov 19, 2025

Add a start command to the tanstack start examples, that uses srvx like the e2e projects

Related to

Summary by CodeRabbit

  • New Features

    • Added a production "start" script to example projects so users can run a production server alongside the client more easily.
  • Bug Fixes / Minor Improvements

    • Normalized formatting and spacing in start scripts across examples to ensure consistent, reliable command invocation.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Walkthrough

Adds or normalizes start scripts that run pnpx srvx --prod -s ../client dist/server/server.js across many example and e2e package.json files; several files also had minor spacing or trailing-comma formatting changes in their scripts entries.

Changes

Cohort / File(s) Summary
React example package.json files
examples/react/start-{bare,basic-auth,basic-react-query,basic-rsc (package.disabled.json),basic-static,clerk-basic,convex-trellaux,counter,large,material-ui,streaming-data-from-server-functions,supabase-basic,trellaux,workos}/package.json
Added start script: pnpx srvx --prod -s ../client dist/server/server.js (in some files spacing normalized) and added trailing commas to build lines where required for JSON formatting.
Solid example package.json files
examples/solid/start-{basic,basic-auth,basic-solid-query,basic-static,convex-better-auth,counter,large,streaming-data-from-server-functions,supabase-basic}/package.json
Added start script: pnpx srvx --prod -s ../client dist/server/server.js and adjusted build line formatting (trailing commas) where needed.
e2e React start package.json files
e2e/react-start/{basic,basic-react-query,basic-tsr-config,query-integration,scroll-restoration,selective-ssr,server-functions,server-routes,virtual-routes,website}/package.json
Normalized spacing in existing start scripts (removed extra space between ../client and dist/server/server.js), keeping command semantics.
e2e Solid start package.json files
e2e/solid-start/{basic,basic-tsr-config,scroll-restoration,selective-ssr,server-functions,server-routes,virtual-routes,website}/package.json
Normalized spacing in existing start scripts (removed extra space between ../client and dist/server/server.js), no behavioral changes.

Sequence Diagram(s)

(Skipped — changes are manifest edits and do not alter runtime control flow.)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Pay attention to consistent script text across files (exact command and single-space usage).
  • Verify JSON validity where trailing commas were added and ensure no accidental syntax errors.
  • Spot-check a representative subset rather than every file (changes are highly repetitive).

Possibly related PRs

Suggested labels

documentation

Suggested reviewers

  • schiller-manuel

Poem

🐰 I hopped through packages, one by one,

Tweaked a start, then called it done.
Spaces fixed and scripts aligned,
Servers ready, neatly signed.
Hooves up — the little rabbit's fun! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding start commands to examples for launching production builds using srvx across multiple example projects.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch example--add-prod-start-command

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Nov 19, 2025

View your CI Pipeline Execution ↗ for commit 3f5cd8b

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 5m 25s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-19 23:35:07 UTC

@birkskyum birkskyum changed the title example: add prod start command example: add start command for launching prod build Nov 19, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 14

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 532669e and 59d6dc8.

📒 Files selected for processing (23)
  • examples/react/start-bare/package.json (1 hunks)
  • examples/react/start-basic-auth/package.json (1 hunks)
  • examples/react/start-basic-react-query/package.json (1 hunks)
  • examples/react/start-basic-rsc/package.disabled.json (1 hunks)
  • examples/react/start-basic-static/package.json (1 hunks)
  • examples/react/start-clerk-basic/package.json (1 hunks)
  • examples/react/start-convex-trellaux/package.json (1 hunks)
  • examples/react/start-counter/package.json (1 hunks)
  • examples/react/start-large/package.json (1 hunks)
  • examples/react/start-material-ui/package.json (1 hunks)
  • examples/react/start-streaming-data-from-server-functions/package.json (1 hunks)
  • examples/react/start-supabase-basic/package.json (1 hunks)
  • examples/react/start-trellaux/package.json (1 hunks)
  • examples/react/start-workos/package.json (1 hunks)
  • examples/solid/start-basic-auth/package.json (1 hunks)
  • examples/solid/start-basic-solid-query/package.json (1 hunks)
  • examples/solid/start-basic-static/package.json (1 hunks)
  • examples/solid/start-basic/package.json (1 hunks)
  • examples/solid/start-convex-better-auth/package.json (1 hunks)
  • examples/solid/start-counter/package.json (1 hunks)
  • examples/solid/start-large/package.json (1 hunks)
  • examples/solid/start-streaming-data-from-server-functions/package.json (1 hunks)
  • examples/solid/start-supabase-basic/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.

Applied to files:

  • examples/solid/start-streaming-data-from-server-functions/package.json
  • examples/solid/start-counter/package.json
  • examples/react/start-basic-rsc/package.disabled.json
  • examples/solid/start-basic/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Preview
  • GitHub Check: Test
🔇 Additional comments (13)
examples/solid/start-supabase-basic/package.json (1)

8-10: Verify path structure consistency across all examples.

The start script references ../client and dist/server/server.js, which assumes a specific directory layout. Given that this change is applied to 23 example packages across React and Solid frameworks, please ensure the relative paths are correct for all affected examples.

examples/solid/start-streaming-data-from-server-functions/package.json (1)

9-9: Verify the relative path ../client is correct for this example's location.

From examples/solid/start-streaming-data-from-server-functions/package.json, the path ../client resolves to examples/solid/client/. Please confirm this is the intended client build output location. If the repository structure differs, the path may need adjustment (e.g., ../../client, etc.).

Since this script is replicated across 23 example files per the PR summary, ensure the relative path is correct for each example's directory depth before merging.

examples/solid/start-basic/package.json (1)

8-9: Consistent start script addition with valid JSON syntax.

The trailing comma and new start script are properly formatted. However, note the double space in the srvx command (-s ../client dist/server/server.js). This pattern is replicated across all 8 files—verify this is intentional and not a copy-paste artifact.

examples/react/start-counter/package.json (1)

8-9: JSON syntax and script addition are correct.

The changes follow the same pattern as other examples with proper JSON formatting and trailing commas. The double-space anomaly in the srvx command is present here as well (see earlier note).

examples/react/start-basic-auth/package.json (1)

8-9: Correct JSON formatting for this file's structure.

Unlike other examples, the build script here is simpler and didn't require adjustment. The start script correctly includes a trailing comma since prisma-generate follows. The srvx command is identical to other files (including the double space).

examples/solid/start-basic-solid-query/package.json (1)

8-9: Consistent formatting across Solid examples.

Changes follow the same pattern as other examples. JSON syntax is valid and the start script is correctly positioned with proper trailing commas.

examples/react/start-basic-react-query/package.json (1)

8-9: Standard pattern applied correctly.

The changes align with other React examples. JSON formatting is valid and the trailing comma placement is appropriate.

examples/solid/start-basic-static/package.json (1)

8-9: Consistent formatting applied appropriately.

The trailing comma is correctly added even with a simpler build script. The start script follows the established pattern across all examples.

examples/react/start-supabase-basic/package.json (1)

9-10: Valid formatting consistent with other examples.

Changes follow the established pattern. JSON syntax and trailing comma placement are correct.

examples/react/start-workos/package.json (2)

9-10: Consistent pattern applied uniformly.

Final file follows the same valid pattern. JSON syntax is correct.


1-11: Verify the double-space in the srvx command across all files.

Across all 8 files, the start script contains a double space: -s ../client dist/server/server.js (note two spaces between the path and dist/). This is consistent everywhere, but verify whether this is intentional or a replication of a copy-paste artifact. If unintended, it should be normalized to a single space throughout the PR.

examples/react/start-large/package.json (1)

8-9: Inconsistent script formatting across examples.

Compared to examples/solid/start-convex-better-auth/package.json, the build script here does not have a trailing comma, yet in other files in this PR it does. Additionally, the same double-space issue appears in the start script command value (../client dist/server/server.js). Verify whether there's a repository style guide and ensure consistency.

examples/solid/start-convex-better-auth/package.json (1)

9-10: Fix double space in start script; verify srvx production invocation.

Remove the double space between ../client and dist/server/server.js. Additionally, production documentation for srvx advises against using npx/pnpx directly; the recommended production approach is to use the runtime directly (node, deno, or bun). The --prod flag may override this guidance, but confirm this is the intended production setup by checking srvx's CLI documentation for the --prod flag's behavior.

"dev": "vite dev",
"build": "vite build && tsc --noEmit"
"build": "vite build && tsc --noEmit",
"start": "pnpx srvx --prod -s ../client dist/server/server.js"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify srvx availability and path resolution.

The start script invokes srvx via pnpx, but srvx is not declared in this package's dependencies. Confirm:

  1. srvx is available at the workspace root or as a shared devDependency
  2. The relative path ../client correctly resolves to the Solid client directory in the project structure
  3. The dist/server/server.js output path is produced by the build script

To verify, run:


🏁 Script executed:

#!/bin/bash
# Check if srvx is available in workspace
echo "Checking for srvx in workspace..."
find . -name "package.json" -path "*/node_modules" -prune -o -type f -exec grep -l '"srvx"' {} \; | head -10

# Verify the directory structure assumption
echo "Checking solid start-counter example structure..."
ls -la examples/solid/start-counter/
ls -la examples/solid/start-counter/../client/ 2>/dev/null || echo "Client directory not found"

Length of output: 1514



🏁 Script executed:

#!/bin/bash
# Check the solid examples directory structure
echo "=== Solid examples directory structure ==="
ls -la examples/solid/

echo -e "\n=== Solid start-counter package.json dependencies ==="
cat examples/solid/start-counter/package.json

echo -e "\n=== Check for srvx in solid example and workspace root ==="
grep -r '"srvx"' examples/solid/ 2>/dev/null || echo "No srvx found in solid examples"

echo -e "\n=== Checking workspace root package.json for srvx ==="
cat package.json | head -50

echo -e "\n=== Looking for 'client' directories in solid examples ==="
find examples/solid -type d -name "*client*" 2>/dev/null

echo -e "\n=== Checking if there's a server reference or build output path ==="
ls -la examples/solid/start-counter/dist/ 2>/dev/null || echo "dist directory not found"

Length of output: 7249


🏁 Script executed:

#!/bin/bash
# Check the solid examples directory structure
echo "=== Solid examples directory structure ==="
ls -la examples/solid/

echo -e "\n=== Solid start-counter package.json ==="
cat examples/solid/start-counter/package.json

echo -e "\n=== Check for srvx in solid example and workspace root ==="
grep -r '"srvx"' examples/solid/ 2>/dev/null || echo "No srvx found in solid examples"

echo -e "\n=== Checking workspace root package.json for srvx (first 100 lines) ==="
head -100 package.json

echo -e "\n=== Looking for 'client' directories in solid examples ==="
find examples/solid -type d -name "*client*" 2>/dev/null

echo -e "\n=== Checking solid start-counter tsconfig and structure ==="
cat examples/solid/start-counter/tsconfig.json
cat examples/solid/start-counter/vite.config.ts

Length of output: 10064



🏁 Script executed:

#!/bin/bash
# Search for srvx in entire workspace root package.json
echo "=== Full workspace root package.json (checking for srvx) ==="
grep -n "srvx" package.json || echo "srvx NOT found in workspace root package.json"

# Check other solid start examples for comparison
echo -e "\n=== Checking start-basic package.json start script ==="
cat examples/solid/start-basic/package.json | jq '.scripts'

echo -e "\n=== Checking start-streaming-data-from-server-functions ==="
cat examples/solid/start-streaming-data-from-server-functions/package.json 2>/dev/null | jq '.scripts' || echo "File not found"

# Verify if srvx might be published as npm package
echo -e "\n=== Searching for any npm/pnpx references to srvx in entire repo ==="
find . -name "*.json" -type f ! -path "*/node_modules/*" -exec grep -l "srvx" {} \; | grep -v e2e | head -20

Length of output: 1540


🏁 Script executed:

#!/bin/bash
# Search for srvx in entire workspace root package.json
echo "=== Full workspace root package.json (checking for srvx) ==="
grep -n "srvx" package.json || echo "srvx NOT found in workspace root package.json"

# Check other solid start examples for comparison
echo -e "\n=== Checking start-basic package.json start script ==="
cat examples/solid/start-basic/package.json | jq '.scripts'

echo -e "\n=== Checking start-streaming-data-from-server-functions ==="
cat examples/solid/start-streaming-data-from-server-functions/package.json 2>/dev/null | jq '.scripts' || echo "File not found"

# Verify if srvx might be published as npm package
echo -e "\n=== Searching for srvx in non-e2e package.json files (excluding node_modules) ==="
find . -name "package.json" -type f ! -path "*/node_modules/*" -exec grep -H "srvx" {} \; 2>/dev/null | grep -v e2e | head -20

Length of output: 2863


🏁 Script executed:

#!/bin/bash
# Check react start-clerk-basic to see correct srvx pattern
echo "=== react/start-clerk-basic package.json (correct example) ==="
cat examples/react/start-clerk-basic/package.json | jq '.dependencies, .devDependencies' | head -30

echo -e "\n=== Check for client directories at examples root ==="
ls -la examples/ | grep client

echo -e "\n=== Check if there's a shared client across examples ==="
find examples -maxdepth 2 -type d -name "client" 2>/dev/null

echo -e "\n=== Verify the directory structure for react start examples ==="
ls -la examples/react/start-clerk-basic/

Length of output: 1624


</web_search>


🌐 Web query:

srvx package npm documentation purpose

💡 Result:

srvx is a lightweight "Universal Server" library that exposes a web-standards (Fetch API)–style server API and CLI which runs across JavaScript runtimes (Node.js, Deno, Bun). It provides a serve() handler/instance API, zero‑dependency runtime integrations, a dev CLI (watcher/logger/error handler/static serving), and aims for near‑native Node performance so you can write the same server code for multiple runtimes. [1][2][3]

Sources:

  • npm package page (readme/quick start). [1]
  • Official docs / site (srvx.h3.dev). [2]
  • Package overview / security dashboard (features, runtime support). [3]

</web_search>


🌐 Web query:

srvx CLI --prod -s flag documentation static directory

💡 Result:

Short answer: use --prod to run srvx in production mode and -s

to serve a static directory (the static path is passed before the server entry). Example usage from community posts:

  • pnpx srvx --prod -s ./client dist/server/server.js — starts srvx in production and serves static files from ./client while running the server entry dist/server/server.js. [1][2]

Sources:

  • srvx homepage / docs (CLI exists, built‑in static serving). [1]
  • Community examples showing the exact CLI usage and notes about -s path resolution. [2]

References:
[1] https://srvx.h3.dev/
[2] Example usage / discussions (TanStack / Q&A) showing: pnpx srvx --prod -s ./client dist/server/server.js.


Fix missing srvx dependency and invalid static directory path in start script.

The start script in examples/solid/start-counter/package.json (line 9) references srvx without declaring it as a dependency. The package is a lightweight Universal Server library available on npm, and the -s flag serves static files from the specified directory.

Two issues prevent the script from working:

  1. Missing dependency: srvx must be added to dependencies (like "srvx": "0.8.15" in examples/react/start-clerk-basic/package.json), not invoked via pnpx without declaration.
  2. Invalid path: The relative path ../client from examples/solid/start-counter/ resolves to examples/solid/client/, which does not exist.

Add srvx to dependencies and correct the static directory path to match the actual client output location (likely . or a path relative to where the build places client assets).

🤖 Prompt for AI Agents
In examples/solid/start-counter/package.json around line 9, the start script
uses pnpx srvx and points to a non-existent ../client; add srvx as a dependency
(e.g. "srvx": "0.8.15") so it is installed with the package and update the
"start" script to use the installed binary (remove pnpx) and fix the -s static
path to the actual client assets directory created by your build (e.g. -s
./client or -s . or -s dist/client as appropriate); verify the client build
output and point the -s flag to that exact folder.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 19, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5915

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5915

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5915

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5915

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5915

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5915

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5915

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5915

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5915

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5915

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5915

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5915

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5915

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5915

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5915

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5915

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5915

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5915

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5915

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5915

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5915

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5915

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5915

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@5915

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5915

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5915

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5915

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5915

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5915

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5915

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5915

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5915

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5915

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5915

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5915

commit: 3f5cd8b

@birkskyum birkskyum changed the title example: add start command for launching prod build example: add srvx start command for launching prod build Nov 19, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
examples/solid/start-counter/package.json (1)

8-9: Same critical issues as examples/solid/start-basic/package.json: missing srvx dependency and invalid path.

This file has identical problems to the other file under review. The start script will fail: srvx must be added to devDependencies, and the ../client path must be corrected to point to the actual build output location of client assets.

Previous review comments on this PR provide detailed verification (web search confirming srvx is a real npm package and shell scripts confirming the directory doesn't exist).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 59d6dc8 and 3f5cd8b.

📒 Files selected for processing (41)
  • e2e/react-start/basic-react-query/package.json (1 hunks)
  • e2e/react-start/basic-tsr-config/package.json (1 hunks)
  • e2e/react-start/basic/package.json (1 hunks)
  • e2e/react-start/query-integration/package.json (1 hunks)
  • e2e/react-start/scroll-restoration/package.json (1 hunks)
  • e2e/react-start/selective-ssr/package.json (1 hunks)
  • e2e/react-start/server-functions/package.json (1 hunks)
  • e2e/react-start/server-routes/package.json (1 hunks)
  • e2e/react-start/virtual-routes/package.json (1 hunks)
  • e2e/react-start/website/package.json (1 hunks)
  • e2e/solid-start/basic-tsr-config/package.json (1 hunks)
  • e2e/solid-start/basic/package.json (1 hunks)
  • e2e/solid-start/scroll-restoration/package.json (1 hunks)
  • e2e/solid-start/selective-ssr/package.json (1 hunks)
  • e2e/solid-start/server-functions/package.json (1 hunks)
  • e2e/solid-start/server-routes/package.json (1 hunks)
  • e2e/solid-start/virtual-routes/package.json (1 hunks)
  • e2e/solid-start/website/package.json (1 hunks)
  • examples/react/start-bare/package.json (1 hunks)
  • examples/react/start-basic-auth/package.json (1 hunks)
  • examples/react/start-basic-react-query/package.json (1 hunks)
  • examples/react/start-basic-rsc/package.disabled.json (1 hunks)
  • examples/react/start-basic-static/package.json (1 hunks)
  • examples/react/start-clerk-basic/package.json (1 hunks)
  • examples/react/start-convex-trellaux/package.json (1 hunks)
  • examples/react/start-counter/package.json (1 hunks)
  • examples/react/start-large/package.json (1 hunks)
  • examples/react/start-material-ui/package.json (1 hunks)
  • examples/react/start-streaming-data-from-server-functions/package.json (1 hunks)
  • examples/react/start-supabase-basic/package.json (1 hunks)
  • examples/react/start-trellaux/package.json (1 hunks)
  • examples/react/start-workos/package.json (1 hunks)
  • examples/solid/start-basic-auth/package.json (1 hunks)
  • examples/solid/start-basic-solid-query/package.json (1 hunks)
  • examples/solid/start-basic-static/package.json (1 hunks)
  • examples/solid/start-basic/package.json (1 hunks)
  • examples/solid/start-convex-better-auth/package.json (1 hunks)
  • examples/solid/start-counter/package.json (1 hunks)
  • examples/solid/start-large/package.json (1 hunks)
  • examples/solid/start-streaming-data-from-server-functions/package.json (1 hunks)
  • examples/solid/start-supabase-basic/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • e2e/react-start/server-routes/package.json
  • e2e/solid-start/server-functions/package.json
  • e2e/solid-start/virtual-routes/package.json
  • e2e/react-start/basic-react-query/package.json
  • e2e/solid-start/basic-tsr-config/package.json
🚧 Files skipped from review as they are similar to previous changes (19)
  • examples/solid/start-basic-auth/package.json
  • examples/solid/start-basic-static/package.json
  • examples/solid/start-large/package.json
  • examples/solid/start-basic-solid-query/package.json
  • examples/react/start-trellaux/package.json
  • examples/react/start-large/package.json
  • examples/react/start-workos/package.json
  • examples/react/start-streaming-data-from-server-functions/package.json
  • examples/react/start-supabase-basic/package.json
  • examples/solid/start-supabase-basic/package.json
  • examples/react/start-counter/package.json
  • examples/react/start-basic-auth/package.json
  • examples/react/start-material-ui/package.json
  • examples/react/start-basic-react-query/package.json
  • examples/react/start-basic-static/package.json
  • examples/solid/start-streaming-data-from-server-functions/package.json
  • examples/react/start-clerk-basic/package.json
  • examples/react/start-basic-rsc/package.disabled.json
  • examples/react/start-bare/package.json
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.

Applied to files:

  • e2e/react-start/basic-tsr-config/package.json
  • e2e/solid-start/server-routes/package.json
  • e2e/react-start/selective-ssr/package.json
  • e2e/react-start/virtual-routes/package.json
  • e2e/solid-start/selective-ssr/package.json
  • e2e/solid-start/basic/package.json
  • examples/solid/start-counter/package.json
  • examples/solid/start-basic/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test
🔇 Additional comments (15)
e2e/react-start/website/package.json (1)

10-10: LGTM!

The start script correctly uses srvx in production mode to serve the client and server artifacts. The configuration aligns with the PR objective to normalize start commands across e2e projects, the tool is properly declared as a devDependency, and the relative paths follow the expected monorepo structure.

e2e/react-start/scroll-restoration/package.json (1)

10-10: Whitespace normalization approved.

The start script addition is properly formatted and srvx is available in devDependencies. The relative paths follow the e2e project structure convention.

Please verify that the relative path ../client correctly resolves to the built client assets directory, and that dist/server/server.js is generated by the build step at line 9.

e2e/solid-start/selective-ssr/package.json (1)

10-10: LGTM!

The start script is correctly added with proper JSON formatting, and the required srvx dependency is already present in devDependencies. The command structure aligns with the PR objective of normalizing start scripts across examples.

Please confirm that the srvx command flags (--prod -s ../client) are correct for version ^0.8.6 and that the relative path ../client correctly references the static assets directory from this project's location.

e2e/solid-start/server-routes/package.json (1)

10-10: Start script normalized—looks good.

The production start command is correctly configured with srvx, and the relative paths align with the e2e package structure. The srvx dependency is already declared.

e2e/solid-start/website/package.json (1)

10-10: Start script normalized—consistent with other e2e packages.

The production start command mirrors the formatting and structure in the other e2e package, with srvx properly declared as a dependency.

e2e/solid-start/basic/package.json (1)

12-12: Approved: start script aligns with PR objective.

The addition of the production start script using srvx matches the PR's goal. The command is well-formed, the srvx tool is available in devDependencies, and the relative path structure is consistent with the e2e project layout.

examples/solid/start-convex-better-auth/package.json (2)

10-10: Verify the relative path references in the start script.

The start script on line 10 references ../client for static files and dist/server/server.js as the server entry point. Please confirm that these paths are correct relative to the examples/solid/start-convex-better-auth/ directory structure.


9-10: Remove the trailing comma from the build script.

Line 9 contains an invalid trailing comma after the build script value. JSON does not support trailing commas per specification, and this will cause JSON parsing failures in strict parsers.

Apply this diff to fix the JSON syntax error:

-    "build": "vite build && tsc --noEmit",
+    "build": "vite build && tsc --noEmit"
     "start": "pnpx srvx --prod -s ../client dist/server/server.js"

Likely an incorrect or invalid review comment.

e2e/react-start/selective-ssr/package.json (1)

10-10: Consistent start script with normalized spacing.

The addition of the start script follows the established pattern across e2e projects and correctly uses srvx with proper arguments. The whitespace normalization is clean.

e2e/react-start/basic-tsr-config/package.json (1)

10-10: Consistent start script across e2e projects.

Matches the established pattern; whitespace normalized and command structure is correct.

e2e/react-start/virtual-routes/package.json (1)

10-10: Consistent start script with proper formatting.

Matches pattern across all e2e projects; whitespace is clean.

e2e/react-start/server-functions/package.json (1)

10-10: Consistent start script.

Follows established pattern; command and formatting are correct.

e2e/react-start/basic/package.json (1)

12-12: Consistent start script with whitespace normalization.

Aligns with all other e2e projects in this PR; formatting is clean and correct.

e2e/react-start/query-integration/package.json (1)

10-10: Critical issue: Incorrect relative path will cause runtime failure across all affected projects.

The start script references ../client which does not exist. Based on the vite build configuration using tanstackStart, the static client files are built to dist/client/, not to a parent directory.

Affected files:

  • e2e/react-start/query-integration/package.json (line 10)
  • Also affects: basic, basic-react-query, basic-tsr-config, scroll-restoration, selective-ssr, serialization-adapters, server-functions, server-routes, virtual-routes, website

Required fix:
Change the relative path from ../client to dist/client in all affected start scripts:

"start": "pnpx srvx --prod -s dist/client dist/server/server.js"

The -s flag serves static files from a directory. The vite + tanstackStart plugin outputs client assets to dist/client/ within each project, not to a shared ../client directory that doesn't exist.

⛔ Skipped due to learnings
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.
examples/react/start-convex-trellaux/package.json (1)

10-11: Spacing issue has been resolved.

The start script on line 11 contains exactly one space between ../client and dist/server/server.js, confirming the double-space issue from the previous review has been fixed. The trailing comma on line 10 is correct for JSON syntax.

"dev:e2e": "vite dev",
"build": "vite build && tsc --noEmit",
"start": "pnpx srvx --prod -s ../client dist/server/server.js",
"start": "pnpx srvx --prod -s ../client dist/server/server.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

✓ Script addition aligns with PR objectives.

The new start script correctly uses pnpx srvx --prod with proper client and server paths, matching the normalization pattern across other e2e packages in this PR. The srvx dependency (v^0.8.6) is already available in devDependencies.

Verify that the relative paths (../client and dist/server/server.js) are correct for the actual directory structure of this e2e project. Run this check to confirm:


🏁 Script executed:

#!/bin/bash
# Verify the start script paths exist relative to the e2e/solid-start/scroll-restoration directory

PROJECT_ROOT="e2e/solid-start/scroll-restoration"
CLIENT_PATH="e2e/solid-start/client"
SERVER_BUNDLE="$PROJECT_ROOT/dist/server/server.js"

# Check if ../client resolves correctly
if [ -d "$CLIENT_PATH" ]; then
  echo "✓ Client path (../client) resolves to: $CLIENT_PATH"
else
  echo "✗ Client path (../client) does not exist"
  # Find what's actually at ../client from the project
  ls -la "e2e/solid-start/" 2>/dev/null | grep -E '^d' || echo "  Directory listing failed"
fi

# Note: dist/server/server.js only exists after build, so we just verify the build target
echo "ℹ Server bundle path will be created at build time: $SERVER_BUNDLE"

Length of output: 1143


I've found a critical issue with the script paths. The verification shows that the ../client path does not exist. Let me investigate the actual directory structure to determine what the correct path should be.

I need to investigate the actual repository structure to determine what the correct client path should be. Let me search for other start scripts in the e2e directory and look for any client references.

The web search didn't provide the specific CLI documentation for srvx's -s flag. Let me search the repository directly to find how other e2e projects use srvx and what the correct path structure should be.


---

🏁 Script executed:

```shell
#!/bin/bash
# Search for other start scripts in the e2e/solid-start directory to find the pattern

echo "=== Finding all package.json files in e2e/solid-start ==="
find e2e/solid-start -name "package.json" -type f

echo ""
echo "=== Checking start scripts in e2e/solid-start package.json files ==="
for pkg in $(find e2e/solid-start -name "package.json" -type f); do
  echo "File: $pkg"
  cat "$pkg" | grep -A 2 '"start"' || echo "  No start script found"
  echo ""
done

echo "=== Checking for 'client' directory references in the repository ==="
rg -n "client" e2e/solid-start --type json -C 2 | head -50

Length of output: 6995


The search reveals a critical pattern: 11 packages use the identical broken path ../client, but there is NO client directory in e2e/solid-start/. However, spa-mode uses dist/client, suggesting the static files are built to dist/client. Let me verify the build configuration to understand the correct path.


🏁 Script executed:

#!/bin/bash
# Check vite configuration and build output structure

echo "=== Looking for vite config in scroll-restoration ==="
find e2e/solid-start/scroll-restoration -name "vite.config.*" -o -name "solid.config.*" | head -5

echo ""
echo "=== Checking if dist/client directory exists (after build would be created) ==="
ls -la e2e/solid-start/scroll-restoration/dist 2>/dev/null || echo "dist directory does not exist (expected - not built yet)"

echo ""
echo "=== Searching for vite config in the entire e2e/solid-start directory ==="
find e2e/solid-start -name "vite.config.*" -type f

echo ""
echo "=== Checking one vite.config to understand build output ==="
if [ -f "e2e/solid-start/basic/vite.config.ts" ]; then
  echo "=== Contents of e2e/solid-start/basic/vite.config.ts ==="
  cat "e2e/solid-start/basic/vite.config.ts"
fi

Length of output: 2211


Now let me check the scroll-restoration vite config specifically and verify whether the ../client path was introduced in this PR:


🏁 Script executed:

#!/bin/bash
# Check scroll-restoration's vite config and verify the issue

echo "=== Contents of scroll-restoration vite.config.ts ==="
cat e2e/solid-start/scroll-restoration/vite.config.ts

echo ""
echo "=== Checking git history to see if ../client was recently added ==="
cd e2e/solid-start/scroll-restoration 2>/dev/null || cd . 
git log -p --follow -S '../client' -- 'package.json' 2>/dev/null | head -100 || echo "Git history not available or no matches found"

echo ""
echo "=== Checking if there's any reference to a shared client directory ==="
find e2e/solid-start -maxdepth 1 -type d -name "*client*" 2>/dev/null || echo "No client directories found at e2e/solid-start/ level"

Length of output: 641


Critical: The relative path ../client is broken and will cause runtime failures.

The start script references a non-existent ../client directory. Relative to e2e/solid-start/scroll-restoration/, the path ../client resolves to e2e/solid-start/client/, which does not exist. Based on TanStack Start's default build output structure and the spa-mode package's use of dist/client, the correct path should be dist/client:

- "start": "pnpx srvx --prod -s ../client dist/server/server.js",
+ "start": "pnpx srvx --prod -s dist/client dist/server/server.js",

Note: This same broken path appears in 10 other packages in this PR (basic-solid-query, basic-tsr-config, basic, query-integration, selective-ssr, serialization-adapters, server-functions, server-routes, virtual-routes, website). All 11 packages need this fix.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"start": "pnpx srvx --prod -s ../client dist/server/server.js",
"start": "pnpx srvx --prod -s dist/client dist/server/server.js",
🤖 Prompt for AI Agents
e2e/solid-start/scroll-restoration/package.json lines 10-10: the "start" script
uses a broken relative path "../client" that resolves to a non-existent
directory; update the script to reference the built client output "dist/client"
(so the start command points to dist/client instead of ../client); apply the
same change to the start scripts in the other affected packages:
basic-solid-query, basic-tsr-config, basic, query-integration, selective-ssr,
serialization-adapters, server-functions, server-routes, virtual-routes, and
website.

Comment on lines +8 to +9
"build": "vite build && tsc --noEmit",
"start": "pnpx srvx --prod -s ../client dist/server/server.js"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Fix missing srvx dependency and invalid static directory path.

The start script references srvx without declaring it as a dependency, and points to a non-existent directory. The script will fail when executed.

Add srvx to devDependencies (as in examples/react/start-clerk-basic/package.json), and correct the static path from ../client to the actual build output location of client assets for this project.


I'll verify the review comment by checking the codebase and package information.


---

🏁 Script executed:

```shell
#!/bin/bash
# Verify srvx dependency in start-basic package.json
echo "=== examples/solid/start-basic/package.json ===" 
cat examples/solid/start-basic/package.json | jq '.devDependencies, .dependencies' 2>/dev/null || cat examples/solid/start-basic/package.json

# Check if ../client directory exists
echo -e "\n=== Checking examples/solid/client directory ==="
ls -la examples/solid/client 2>&1 || echo "Directory does not exist"

# Check directory structure
echo -e "\n=== examples/solid directory structure ==="
ls -la examples/solid/

# Compare with react example
echo -e "\n=== examples/react/start-clerk-basic/package.json dependencies ==="
cat examples/react/start-clerk-basic/package.json 2>/dev/null | jq '.devDependencies, .dependencies' || echo "File not found"

Length of output: 5037


🌐 Web query:

srvx npm package documentation dependencies

💡 Result:

Summary — srvx (npm)

  • Documentation / homepage: srvx.h3.dev. [1]
  • npm package page (install: npm i srvx): shows package info and README. [2]
  • Dependencies: srvx is advertised as having zero runtime dependencies (no entries in package.json dependencies). Dev/build tooling uses pnpm/Corepack in the repo. [2][3]

If you want I can fetch the package.json from the srvx GitHub repo and list the exact dependencies/devDependencies with versions.


Fix missing srvx dependency and invalid static directory path in examples/solid/start-basic/package.json.

The start script references srvx without declaring it as a dependency, and points to a non-existent ../client directory. The script will fail when executed.

Add srvx to dependencies (matching examples/react/start-clerk-basic/package.json which declares "srvx": "0.8.15"), and correct the static path to the actual location of client build outputs for this project.

🤖 Prompt for AI Agents
In examples/solid/start-basic/package.json around lines 8 to 9, the start script
references an undeclared `srvx` dependency and an incorrect static path; add
`"srvx": "0.8.15"` to the package.json dependencies (not devDependencies) to
match examples/react/start-clerk-basic, and update the start script static path
from `../client` to the actual client build output directory (e.g.,
`dist/client` or whichever folder your Vite build emits) so the command becomes
`pnpx srvx --prod -s <correct-client-path> dist/server/server.js`.

@birkskyum birkskyum merged commit eda2254 into main Nov 19, 2025
6 checks passed
@birkskyum birkskyum deleted the example--add-prod-start-command branch November 19, 2025 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants