-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
example: add srvx start command for launching prod build #5915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds or normalizes Changes
Sequence Diagram(s)(Skipped — changes are manifest edits and do not alter runtime control flow.) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
|
View your CI Pipeline Execution ↗ for commit 3f5cd8b
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this 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
📒 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.jsonexamples/solid/start-counter/package.jsonexamples/react/start-basic-rsc/package.disabled.jsonexamples/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
../clientanddist/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../clientis correct for this example's location.From
examples/solid/start-streaming-data-from-server-functions/package.json, the path../clientresolves toexamples/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-generatefollows. 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 anddist/). 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
../clientanddist/server/server.js. Additionally, production documentation for srvx advises against usingnpx/pnpxdirectly; the recommended production approach is to use the runtime directly (node, deno, or bun). The--prodflag may override this guidance, but confirm this is the intended production setup by checking srvx's CLI documentation for the--prodflag'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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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:
srvxis available at the workspace root or as a shared devDependency- The relative path
../clientcorrectly resolves to the Solid client directory in the project structure - The
dist/server/server.jsoutput path is produced by thebuildscript
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.tsLength 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 -20Length 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 -20Length 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:
- Missing dependency:
srvxmust be added to dependencies (like"srvx": "0.8.15"inexamples/react/start-clerk-basic/package.json), not invoked viapnpxwithout declaration. - Invalid path: The relative path
../clientfromexamples/solid/start-counter/resolves toexamples/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.
examples/solid/start-streaming-data-from-server-functions/package.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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 asexamples/solid/start-basic/package.json: missingsrvxdependency and invalid path.This file has identical problems to the other file under review. The
startscript will fail:srvxmust be added todevDependencies, and the../clientpath 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
srvxis a real npm package and shell scripts confirming the directory doesn't exist).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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.jsone2e/solid-start/server-routes/package.jsone2e/react-start/selective-ssr/package.jsone2e/react-start/virtual-routes/package.jsone2e/solid-start/selective-ssr/package.jsone2e/solid-start/basic/package.jsonexamples/solid/start-counter/package.jsonexamples/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
srvxin 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
srvxis available in devDependencies. The relative paths follow the e2e project structure convention.Please verify that the relative path
../clientcorrectly resolves to the built client assets directory, and thatdist/server/server.jsis generated by the build step at line 9.e2e/solid-start/selective-ssr/package.json (1)
10-10: LGTM!The
startscript is correctly added with proper JSON formatting, and the requiredsrvxdependency is already present in devDependencies. The command structure aligns with the PR objective of normalizing start scripts across examples.Please confirm that the
srvxcommand flags (--prod -s ../client) are correct for version ^0.8.6 and that the relative path../clientcorrectly 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. Thesrvxdependency 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
srvxproperly declared as a dependency.e2e/solid-start/basic/package.json (1)
12-12: Approved:startscript aligns with PR objective.The addition of the production start script using
srvxmatches the PR's goal. The command is well-formed, thesrvxtool 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
../clientfor static files anddist/server/server.jsas the server entry point. Please confirm that these paths are correct relative to theexamples/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
startscript follows the established pattern across e2e projects and correctly usessrvxwith 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
startscript references../clientwhich does not exist. Based on the vite build configuration using tanstackStart, the static client files are built todist/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../clienttodist/clientin all affected start scripts:"start": "pnpx srvx --prod -s dist/client dist/server/server.js"The
-sflag serves static files from a directory. The vite + tanstackStart plugin outputs client assets todist/client/within each project, not to a shared../clientdirectory 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
../clientanddist/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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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"
fiLength 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.
| "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.
| "build": "vite build && tsc --noEmit", | ||
| "start": "pnpx srvx --prod -s ../client dist/server/server.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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`.
Add a
startcommand to the tanstack start examples, that usessrvxlike the e2e projectsRelated to
Summary by CodeRabbit
New Features
Bug Fixes / Minor Improvements
✏️ Tip: You can customize this high-level summary in your review settings.