Skip to content

docs: fix cli create commands#6959

Merged
birkskyum merged 5 commits intoTanStack:mainfrom
birkskyum:fix--cli-create-cli-commands
Mar 17, 2026
Merged

docs: fix cli create commands#6959
birkskyum merged 5 commits intoTanStack:mainfrom
birkskyum:fix--cli-create-cli-commands

Conversation

@birkskyum
Copy link
Copy Markdown
Member

@birkskyum birkskyum commented Mar 17, 2026

Running npm create @tanstack/start@latest causes a

Warning: @tanstack/create-start is deprecated. Use "tanstack create" or "npx @tanstack/cli create" instead.
See: https://tanstack.com/start/latest/docs/framework/react/quick-start

Therefore, I've updated to use the npx @tanstack/cli@latest create everywhere

Summary by CodeRabbit

  • Documentation

    • Standardized CLI examples across React and Solid to use the TanStack CLI via npx and updated CLI links; unified bootstrap instructions in getting-started, quick-start, hosting, and tutorial pages.
  • New Tutorials

    • Added two Solid tutorials: one showing external API integration and end-to-end data flow; another demonstrating a file-backed read/write example with UI walkthroughs, server-driven data handling, and testing tips.

@github-actions github-actions bot added the documentation Everything documentation related label Mar 17, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d5c2b457-08e0-4bc7-9832-71532af21cf8

📥 Commits

Reviewing files that changed from the base of the PR and between 0a01e77 and 26428ec.

📒 Files selected for processing (2)
  • docs/start/framework/react/getting-started.md
  • docs/start/framework/solid/getting-started.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/start/framework/solid/getting-started.md

📝 Walkthrough

Walkthrough

Standardized CLI bootstrap examples to npx @tanstack/cli@latest create across React and Solid docs. Added two Solid tutorials (external API fetching with TMDB; reading/writing file DevJokes) and new example source files (server functions, types, Solid UI components) supporting the DevJokes tutorial.

Changes

Cohort / File(s) Summary
React Docs
docs/start/framework/react/getting-started.md, docs/start/framework/react/quick-start.md, docs/start/framework/react/guide/hosting.md, docs/start/framework/react/tutorial/reading-writing-file.md
Replaced previous bootstrap invocations (npm create @tanstack/start@latest, pnpm create ...) with npx @tanstack/cli@latest create in CLI examples and updated CLI link.
Solid Docs (guides & quick-start)
docs/start/framework/solid/getting-started.md, docs/start/framework/solid/quick-start.md, docs/start/framework/solid/guide/hosting.md
Replaced Solid-specific bootstrap commands with npx @tanstack/cli@latest create --framework solid and updated CLI links.
Solid Tutorials (new)
docs/start/framework/solid/tutorial/fetching-external-api.md, docs/start/framework/solid/tutorial/reading-writing-file.md
Added two full tutorial documents: TMDB external-API fetching (loaders, server functions, UI, sequence diagram) and DevJokes file-based read/write tutorial (server functions, types, components, routing, tests).
Example App Source (new)
src/serverActions/jokesActions.ts, src/types/index.ts, src/components/JokesList.tsx, src/components/JokeForm.tsx
New example implementation for DevJokes: server functions (getJokes, addJoke), TypeScript types (Joke, JokesData), and Solid UI components for listing and adding jokes referenced by the tutorial.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Client UI
  participant Loader as Route Loader
  participant Server as Server Function
  participant External as External API (TMDB) 
  Client->>Loader: Request page /movies
  Loader->>Server: call fetchMoviesLoader()
  Server->>External: fetch TMDB (API key from env)
  External-->>Server: movies JSON
  Server-->>Loader: return movies data
  Loader-->>Client: render page with movies
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I hopped through docs and code tonight,

Swapped commands so starters light,
TMDB calls and jokes that stay,
Server, loader, UI play.
A tiny rabbit cheers the site! 🥕

🚥 Pre-merge checks | ✅ 3
✅ 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 'docs: fix cli create commands' accurately summarizes the main change—updating documentation to replace deprecated CLI commands with the new TanStack CLI invocation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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
Copy Markdown
Contributor

nx-cloud bot commented Mar 17, 2026

View your CI Pipeline Execution ↗ for commit 26428ec

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

☁️ Nx Cloud last updated this comment at 2026-03-17 21:45:13 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 17, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@6959

@tanstack/eslint-plugin-router

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

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@6959

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@6959

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@6959

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@6959

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@6959

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@6959

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@6959

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@6959

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@6959

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@6959

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@6959

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@6959

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@6959

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@6959

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@6959

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@6959

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@6959

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@6959

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@6959

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@6959

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@6959

commit: 26428ec

Copy link
Copy Markdown
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/start/framework/solid/getting-started.md`:
- Line 10: The Markdown contains a malformed link reference `[TanStack Start
CLI]` with no target; replace that token with an inline internal docs link using
the same link text and a docs-relative path (e.g., change `[TanStack Start CLI]`
to `[TanStack Start CLI](<relative-doc-path>)`) so the sentence reads like "
[TanStack Start CLI](... ) - Just run `npx `@tanstack/cli`@latest create
--framework solid`."; ensure the link target is a relative link under the docs
tree per the Markdown guidelines.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b4fd1932-ff27-4a1c-b51f-df61e09a9037

📥 Commits

Reviewing files that changed from the base of the PR and between 7d936c6 and c0ebfbe.

📒 Files selected for processing (7)
  • docs/start/framework/react/getting-started.md
  • docs/start/framework/react/guide/hosting.md
  • docs/start/framework/react/quick-start.md
  • docs/start/framework/react/tutorial/reading-writing-file.md
  • docs/start/framework/solid/getting-started.md
  • docs/start/framework/solid/guide/hosting.md
  • docs/start/framework/solid/quick-start.md

Choose one of the following options to start building a _new_ TanStack Start project:

- [TanStack Start CLI] - Just run `npm create @tanstack/start@latest --framework solid`. Local, fast, and optionally customizable
- [TanStack Start CLI] - Just run `npx @tanstack/cli@latest create --framework solid`. Local, fast, and optionally customizable
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix malformed Markdown link for “TanStack Start CLI”.

[TanStack Start CLI] has no link target, so this renders as a broken/malformed link reference.

Suggested edit
-- [TanStack Start CLI] - Just run `npx `@tanstack/cli`@latest create --framework solid`. Local, fast, and optionally customizable
+- [TanStack Start CLI](./quick-start) - Just run `npx `@tanstack/cli`@latest create --framework solid`. Local, fast, and optionally customizable

As per coding guidelines, **/*.md: Use internal docs links relative to docs/ folder (e.g., ./guide/data-loading).

📝 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
- [TanStack Start CLI] - Just run `npx @tanstack/cli@latest create --framework solid`. Local, fast, and optionally customizable
- [TanStack Start CLI](./quick-start) - Just run `npx `@tanstack/cli`@latest create --framework solid`. Local, fast, and optionally customizable
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/start/framework/solid/getting-started.md` at line 10, The Markdown
contains a malformed link reference `[TanStack Start CLI]` with no target;
replace that token with an inline internal docs link using the same link text
and a docs-relative path (e.g., change `[TanStack Start CLI]` to `[TanStack
Start CLI](<relative-doc-path>)`) so the sentence reads like " [TanStack Start
CLI](... ) - Just run `npx `@tanstack/cli`@latest create --framework solid`.";
ensure the link target is a relative link under the docs tree per the Markdown
guidelines.

Copy link
Copy Markdown
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: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/start/framework/solid/tutorial/fetching-external-api.md`:
- Line 300: Replace the nonstandard capitalization/hyphenation "Server-Side
rendering" with the standard phrase "server-side rendering" in the sentence that
currently reads "3. Server-Side rendering: The data is fetched on the server
reducing the load on the client side" (search for that exact phrase) and also
apply the same hyphenation/case to any other occurrences of "Server-Side
rendering" in this document to ensure consistent wording.
- Around line 130-137: The fetchPopularMovies handler calls TMDB using
process.env.TMDB_AUTH_TOKEN without checking it; add an explicit guard at the
start of the createServerFn().handler (fetchPopularMovies) to throw or return an
error when process.env.TMDB_AUTH_TOKEN is missing or empty before calling
fetch(API_URL), so the request is never attempted with a missing token and the
failure is surfaced; reference the TMDB_AUTH_TOKEN env-var and ensure the
handler responds with a clear error (or throws) indicating the missing token.
- Line 25: Replace the site-absolute markdown link "[TanStack
Router](/router/latest/docs/framework/solid/routing/routing-concepts)" in
fetching-external-api.md with a docs-relative (file‑relative) path to the target
markdown (use a relative path from this file to the routing-concepts doc);
update the same pattern found at the other occurrence around line 314 as well so
all internal docs links are file-relative rather than starting with a leading
slash.
- Around line 31-34: Update the example command in the tutorial to use the
standardized TanStack CLI invocation: replace the existing "pnpx
create-start-app movie-discovery" snippet with "npx `@tanstack/cli`@latest create
--framework solid movie-discovery" while keeping the following "cd
movie-discovery" line unchanged so the tutorial matches the other
getting-started docs.

In `@docs/start/framework/solid/tutorial/reading-writing-file.md`:
- Around line 64-80: The fenced project tree block in the markdown (the
triple-backtick block that lists /devjokes, src/, public/, etc.) lacks a
language identifier; update that fenced code block to use ```text so markdown
linting passes (edit the code block in
docs/start/framework/solid/tutorial/reading-writing-file.md that contains the
project tree).
- Around line 212-215: The import paths in the index.tsx snippet are wrong: from
src/routes/index.tsx the relative imports for createFileRoute/getJokes/JokesList
should go up one level; update the import specifiers referencing
createFileRoute, getJokes, and JokesList so they use ../ (one directory up)
rather than the current paths so the modules resolve correctly.
- Around line 390-414: The handleSubmit function must accept the form submit
event and call event.preventDefault() to stop the browser's default
submit/reload behavior; update the handleSubmit signature to take an Event (or
SubmitEvent) parameter, call event.preventDefault() at the top, then proceed
with the existing logic (setIsSubmitting, addJoke, clearing fields,
router.invalidate, error handling) so the async flow runs without a page reload;
reference the handleSubmit function and the form's onSubmit handler when making
this change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b54ed099-6c52-421a-8f1c-c90a3e0b92be

📥 Commits

Reviewing files that changed from the base of the PR and between c0ebfbe and 0a01e77.

📒 Files selected for processing (3)
  • docs/start/framework/solid/guide/hosting.md
  • docs/start/framework/solid/tutorial/fetching-external-api.md
  • docs/start/framework/solid/tutorial/reading-writing-file.md


## Nice to know

- [TanStack Router](/router/latest/docs/framework/solid/routing/routing-concepts)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Internal docs links should be relative, not site-absolute.
Please switch these to docs-relative links so they remain consistent with repo navigation rules.
As per coding guidelines, "**/*.md: Use internal docs links relative to docs/ folder (e.g., ./guide/data-loading)".
Based on learnings, “use file-relative paths … for links between markdown files within the same project.”

Also applies to: 314-314

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/start/framework/solid/tutorial/fetching-external-api.md` at line 25,
Replace the site-absolute markdown link "[TanStack
Router](/router/latest/docs/framework/solid/routing/routing-concepts)" in
fetching-external-api.md with a docs-relative (file‑relative) path to the target
markdown (use a relative path from this file to the routing-concepts doc);
update the same pattern found at the other occurrence around line 314 as well so
all internal docs links are file-relative rather than starting with a leading
slash.

Comment on lines +31 to +34
```bash
pnpx create-start-app movie-discovery
cd movie-discovery
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's see what CLI commands are used elsewhere in the documentation
find docs -name "*.md" -type f | head -20

Repository: TanStack/router

Length of output: 895


🏁 Script executed:

# Search for patterns of create commands in documentation files
rg "create-start-app|@tanstack/cli" docs/ --type md -A 2 -B 2

Repository: TanStack/router

Length of output: 4038


🏁 Script executed:

# Check git history to understand PR context
git log --oneline --all | grep -i "cli\|create\|start" | head -20

Repository: TanStack/router

Length of output: 1586


🏁 Script executed:

# Look for package.json or README that might indicate the official CLI command
find . -maxdepth 3 -name "package.json" -o -name "README.md" | xargs grep -l "create-start-app\|@tanstack/cli" 2>/dev/null | head -10

Repository: TanStack/router

Length of output: 41


Update to standardized TanStack CLI create command.

The pnpx create-start-app command is inconsistent with the documentation standard across getting-started, quick-start, guide, and other tutorial sections, which all use npx @tanstack/cli@latest create --framework solid.

Suggested fix
-```bash
-pnpx create-start-app movie-discovery
-cd movie-discovery
-```
+```bash
+npx `@tanstack/cli`@latest create --framework solid movie-discovery
+cd movie-discovery
+```
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/start/framework/solid/tutorial/fetching-external-api.md` around lines 31
- 34, Update the example command in the tutorial to use the standardized
TanStack CLI invocation: replace the existing "pnpx create-start-app
movie-discovery" snippet with "npx `@tanstack/cli`@latest create --framework solid
movie-discovery" while keeping the following "cd movie-discovery" line unchanged
so the tutorial matches the other getting-started docs.

Comment on lines +130 to +137
const fetchPopularMovies = createServerFn().handler(
async (): Promise<TMDBResponse> => {
const response = await fetch(API_URL, {
headers: {
accept: 'application/json',
Authorization: `Bearer ${process.env.TMDB_AUTH_TOKEN}`,
},
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add an explicit env-var guard before calling TMDB.
This avoids silent auth failures when TMDB_AUTH_TOKEN is missing.

Suggested fix
 const fetchPopularMovies = createServerFn().handler(
   async (): Promise<TMDBResponse> => {
+    if (!process.env.TMDB_AUTH_TOKEN) {
+      throw new Error('TMDB_AUTH_TOKEN is not set')
+    }
     const response = await fetch(API_URL, {
       headers: {
         accept: 'application/json',
         Authorization: `Bearer ${process.env.TMDB_AUTH_TOKEN}`,
       },
     })
📝 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
const fetchPopularMovies = createServerFn().handler(
async (): Promise<TMDBResponse> => {
const response = await fetch(API_URL, {
headers: {
accept: 'application/json',
Authorization: `Bearer ${process.env.TMDB_AUTH_TOKEN}`,
},
})
const fetchPopularMovies = createServerFn().handler(
async (): Promise<TMDBResponse> => {
if (!process.env.TMDB_AUTH_TOKEN) {
throw new Error('TMDB_AUTH_TOKEN is not set')
}
const response = await fetch(API_URL, {
headers: {
accept: 'application/json',
Authorization: `Bearer ${process.env.TMDB_AUTH_TOKEN}`,
},
})
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/start/framework/solid/tutorial/fetching-external-api.md` around lines
130 - 137, The fetchPopularMovies handler calls TMDB using
process.env.TMDB_AUTH_TOKEN without checking it; add an explicit guard at the
start of the createServerFn().handler (fetchPopularMovies) to throw or return an
error when process.env.TMDB_AUTH_TOKEN is missing or empty before calling
fetch(API_URL), so the request is never attempted with a missing token and the
failure is surfaced; reference the TMDB_AUTH_TOKEN env-var and ensure the
handler responds with a clear error (or throws) indicating the missing token.


1. Route loader: When a user visits `/fetch-movies`, the loader function runs on the server
2. API call: The loader calls `fetchPopularMovies()` which makes an HTTP request to TMDB
3. Server-Side rendering: The data is fetched on the server reducing the load on the client side
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use standard hyphenation: “server-side rendering.”
Minor wording polish for consistency.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~300-~300: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... on the server reducing the load on the client side 4. Component rendering: The `MoviesPage...

(EN_COMPOUND_ADJECTIVE_INTERNAL)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/start/framework/solid/tutorial/fetching-external-api.md` at line 300,
Replace the nonstandard capitalization/hyphenation "Server-Side rendering" with
the standard phrase "server-side rendering" in the sentence that currently reads
"3. Server-Side rendering: The data is fetched on the server reducing the load
on the client side" (search for that exact phrase) and also apply the same
hyphenation/case to any other occurrences of "Server-Side rendering" in this
document to ensure consistent wording.

Comment on lines +64 to +80
```
/devjokes
├── src/
│ ├── routes/
│ │ ├── demo/ # Demo routes
│ │ ├── __root.tsx # Root layout
│ │ └── index.tsx # Home page
│ ├── components/ # Solid components
│ ├── data/ # Data files
│ ├── router.tsx # Router configuration
│ ├── routeTree.gen.ts # Generated route tree
│ └── styles.css # Global styles
├── public/ # Static assets
├── vite.config.ts # TanStack Start configuration
├── package.json # Project dependencies
└── tsconfig.json # TypeScript configuration
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add a language identifier to the fenced code block.
Use ```text for the project tree block to satisfy markdown linting.

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 64-64: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/start/framework/solid/tutorial/reading-writing-file.md` around lines 64
- 80, The fenced project tree block in the markdown (the triple-backtick block
that lists /devjokes, src/, public/, etc.) lacks a language identifier; update
that fenced code block to use ```text so markdown linting passes (edit the code
block in docs/start/framework/solid/tutorial/reading-writing-file.md that
contains the project tree).

Comment on lines +212 to +215
// src/routes/index.tsx
import { createFileRoute } from '@tanstack/solid-router'
import { getJokes } from './serverActions/jokesActions'
import { JokesList } from './JokesList'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Import paths in the index.tsx snippet are incorrect.
From src/routes/index.tsx, both paths should go up one level.

Suggested fix
 import { createFileRoute } from '@tanstack/solid-router'
-import { getJokes } from './serverActions/jokesActions'
-import { JokesList } from './JokesList'
+import { getJokes } from '../serverActions/jokesActions'
+import { JokesList } from '../components/JokesList'
📝 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
// src/routes/index.tsx
import { createFileRoute } from '@tanstack/solid-router'
import { getJokes } from './serverActions/jokesActions'
import { JokesList } from './JokesList'
// src/routes/index.tsx
import { createFileRoute } from '@tanstack/solid-router'
import { getJokes } from '../serverActions/jokesActions'
import { JokesList } from '../components/JokesList'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/start/framework/solid/tutorial/reading-writing-file.md` around lines 212
- 215, The import paths in the index.tsx snippet are wrong: from
src/routes/index.tsx the relative imports for createFileRoute/getJokes/JokesList
should go up one level; update the import specifiers referencing
createFileRoute, getJokes, and JokesList so they use ../ (one directory up)
rather than the current paths so the modules resolve correctly.

Comment on lines +390 to +414
const handleSubmit = async () => {
if (!question() || !answer() || isSubmitting()) return
try {
setIsSubmitting(true)
await addJoke({
data: { question(), answer() },
})

// Clear form
setQuestion('')
setAnswer('')

// Refresh data
router.invalidate()
} catch (error) {
console.error('Failed to add joke:', error)
setError('Failed to add joke')
} finally {
setIsSubmitting(false)
}
}

return (
<form onSubmit={handleSubmit} class="mb-8">
{error && (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n docs/start/framework/solid/tutorial/reading-writing-file.md | sed -n '380,420p'

Repository: TanStack/router

Length of output: 1496


🌐 Web query:

Solid.js form submission preventDefault handler event parameter

💡 Result:

In Solid.js, for a standard HTML form submission handler using the onSubmit event, the event parameter is a SubmitEvent (typed as JSX.EventHandler<HTMLFormElement, SubmitEvent>). This event has a preventDefault method to stop the default form submission behavior (page reload). Example: function MyForm { const handleSubmit = (e: SubmitEvent) => { e.preventDefault; // Handle form data, e.g., const formData = new FormData(e.currentTarget); console.log('Form submitted'); }; return (

Submit ); } The currentTarget is the HTMLFormElement. Solid.js uses delegated events for onSubmit, but the API is standard DOM. Official docs confirm event handlers receive native DOM events [6,22]. TypeScript typing from Solid.js repo shows Event & { submitter: HTMLElement } & { currentTarget: HTMLFormElement; target: Element; } [16]. Note: In Solid Router/Solid Start, use action with instead of onSubmit; it handles preventDefault automatically [4,5]. Form libraries like Modular Forms pass form values first, event second, and call preventDefault internally [1].

Citations:


Add preventDefault() to the handleSubmit form submission.
Without it, the browser's default form submission will trigger a page reload despite the async handler completing. The form handler should accept and prevent the submit event.

Suggested fix
-  const handleSubmit = async () => {
+  const handleSubmit = async (e: SubmitEvent) => {
+    e.preventDefault()
     if (!question() || !answer() || isSubmitting()) return
📝 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
const handleSubmit = async () => {
if (!question() || !answer() || isSubmitting()) return
try {
setIsSubmitting(true)
await addJoke({
data: { question(), answer() },
})
// Clear form
setQuestion('')
setAnswer('')
// Refresh data
router.invalidate()
} catch (error) {
console.error('Failed to add joke:', error)
setError('Failed to add joke')
} finally {
setIsSubmitting(false)
}
}
return (
<form onSubmit={handleSubmit} class="mb-8">
{error && (
const handleSubmit = async (e: SubmitEvent) => {
e.preventDefault()
if (!question() || !answer() || isSubmitting()) return
try {
setIsSubmitting(true)
await addJoke({
data: { question(), answer() },
})
// Clear form
setQuestion('')
setAnswer('')
// Refresh data
router.invalidate()
} catch (error) {
console.error('Failed to add joke:', error)
setError('Failed to add joke')
} finally {
setIsSubmitting(false)
}
}
return (
<form onSubmit={handleSubmit} class="mb-8">
{error && (
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/start/framework/solid/tutorial/reading-writing-file.md` around lines 390
- 414, The handleSubmit function must accept the form submit event and call
event.preventDefault() to stop the browser's default submit/reload behavior;
update the handleSubmit signature to take an Event (or SubmitEvent) parameter,
call event.preventDefault() at the top, then proceed with the existing logic
(setIsSubmitting, addJoke, clearing fields, router.invalidate, error handling)
so the async flow runs without a page reload; reference the handleSubmit
function and the form's onSubmit handler when making this change.

@birkskyum birkskyum merged commit 6db686a into TanStack:main Mar 17, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Everything documentation related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant