Skip to content

Conversation

@schiller-manuel
Copy link
Contributor

@schiller-manuel schiller-manuel commented Jan 8, 2026

Summary by CodeRabbit

  • Chores
    • Added Nitro nightly as a development dependency to React and Solid example projects
    • Integrated Nitro plugin into Vite build configuration for both React and Solid examples
    • Updated start script in the Solid example to invoke the compiled server directly

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

📝 Walkthrough

Walkthrough

Updates two example projects (React and Solid) to integrate Nitro nightly builds by adding the nitro Vite plugin, updating package dependencies, modifying start scripts, and removing the context parameter from a handler function signature.

Changes

Cohort / File(s) Summary
React Start Basic - Package & Config
examples/react/start-basic/package.json, examples/react/start-basic/vite.config.ts
Added nitro-nightly as devDependency; integrated nitro Vite plugin with new import and plugin invocation
React Start Basic - Handler Update
examples/react/start-basic/src/utils/posts.tsx
Removed context parameter from handler signature; changed from async ({ data, context }) to async ({ data })
Solid Start Basic - Package & Config
examples/solid/start-basic/package.json, examples/solid/start-basic/vite.config.ts
Updated start script from pnpx srvx --prod to direct Node invocation of .output/server/index.mjs; added nitro-nightly devDependency; integrated nitro Vite plugin

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰✨ Nitro nights now light the way,
With plugins plugged and scripts at play,
Context gone, but handlers stay,
Examples shine with nightly sway! 🌙

🚥 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 'examples: make basic runnable with nitro' accurately summarizes the main change: integrating Nitro into the basic example projects to make them runnable.
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 docstrings

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

@nx-cloud
Copy link

nx-cloud bot commented Jan 8, 2026

View your CI Pipeline Execution ↗ for commit ae46b66

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

☁️ Nx Cloud last updated this comment at 2026-01-08 21:46:18 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 8, 2026

More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-fn-stubs@6336

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start@6336

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: ae46b66

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

🤖 Fix all issues with AI agents
In @examples/react/start-basic/package.json:
- Line 27: The package.json uses an unstable dependency mapping ("nitro":
"npm:nitro-nightly@latest"); update the "nitro" entry to point to the stable
release instead (for example use "nitro": "npm:nitropack@2.12.5" or the official
stable "nitro" package at the corresponding stable version) so the example
project depends on a stable nitro release rather than the nightly build.

In @examples/solid/start-basic/vite.config.ts:
- Line 6: The plugins array currently runs viteSolid before the Nitro plugin;
reorder the plugins so nitro() appears before viteSolid({ ssr: true }) and after
tanstackStart(), following the required sequence (static tooling →
tanstackStart() → nitro() → viteSolid({ ssr: true)); adjust the import/use of
nitro from 'nitro/vite' accordingly and ensure tanstackStart() remains before
nitro() and viteSolid is last.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0caca3f and ae46b66.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • examples/react/start-basic/package.json
  • examples/react/start-basic/src/utils/posts.tsx
  • examples/react/start-basic/vite.config.ts
  • examples/solid/start-basic/package.json
  • examples/solid/start-basic/vite.config.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode with extensive type safety for all code

Files:

  • examples/react/start-basic/src/utils/posts.tsx
  • examples/solid/start-basic/vite.config.ts
  • examples/react/start-basic/vite.config.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Implement ESLint rules for router best practices using the ESLint plugin router

Files:

  • examples/react/start-basic/src/utils/posts.tsx
  • examples/solid/start-basic/vite.config.ts
  • examples/react/start-basic/vite.config.ts
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Use workspace protocol workspace:* for internal dependencies in package.json files

Files:

  • examples/react/start-basic/package.json
  • examples/solid/start-basic/package.json
🧠 Learnings (1)
📚 Learning: 2025-12-24T22:47:44.320Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 6211
File: e2e/react-start/i18n-paraglide/src/server.ts:6-6
Timestamp: 2025-12-24T22:47:44.320Z
Learning: In TanStack Router projects using `inlang/paraglide-js`, the callback passed to `paraglideMiddleware` should use `() => handler.fetch(req)` (referencing the outer `req`) instead of `({ request }) => handler.fetch(request)`. This is intentional because the router needs the untouched URL to perform its own rewrite logic with `deLocalizeUrl`/`localizeUrl`. The middleware's processed request would delocalize the URL and interfere with the router's rewrite handling.

Applied to files:

  • examples/react/start-basic/src/utils/posts.tsx
⏰ 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 (4)
examples/solid/start-basic/package.json (2)

10-10: LGTM!

The start script correctly points to Nitro's expected output path .output/server/index.mjs.


23-23: Workspace protocol (workspace:*) does not apply to external npm packages.

The "nitro": "npm:nitro-nightly@latest" dependency uses an npm alias for an external package, not an internal workspace package. The workspace protocol rule applies only to internal dependencies (those referenced as workspace:*). Additionally, nitro is a devDependency (build tool) used consistently across all TanStack Start examples, suggesting this is intentional for framework compatibility.

Likely an incorrect or invalid review comment.

examples/react/start-basic/src/utils/posts.tsx (1)

12-12: No context parameter found in current handler signature.

The handler currently uses only the data parameter from the inputValidator (async ({ data })), and no context parameter is present. The code is functionally correct: data is properly received and used on line 13. Both fetchPost usages in the codebase correctly pass the data parameter, and the alternative fetchPosts handler demonstrates the createServerFn API accepts flexible parameter patterns.

Likely an incorrect or invalid review comment.

examples/react/start-basic/vite.config.ts (1)

6-6: Clarify Nitro plugin placement with explicit enforce/apply properties.

Plugin order matters in Vite, but relying on array position is implicit. Verify that the Nitro plugin uses explicit enforce and apply properties to control placement relative to Vite's core plugins, rather than depending on array order. Test both dev (serve) and build flows.

"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.6.0",
"nitro": "npm:nitro-nightly@latest",
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 | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's explore the repository structure to understand the project layout
git ls-files | grep -E "(package\.json|nitro)" | head -20

Repository: TanStack/router

Length of output: 1118


🏁 Script executed:

# Check the full content of the package.json file in question
cat examples/react/start-basic/package.json

Repository: TanStack/router

Length of output: 947


🏁 Script executed:

# Look for other package.json files to understand the workspace structure
find . -name "package.json" -type f | head -20

Repository: TanStack/router

Length of output: 1158


🌐 Web query:

latest stable version of Nitro JavaScript framework

💡 Result:

The latest stable release is nitropack (Nitro v2) v2.12.5. The v3 release is currently in alpha/beta (e.g., 3.0.1‑alpha). [1][2][3]

Sources:

  • npm: nitropack v2.12.5. [1]
  • Nitro v3 docs (alpha/beta migration notes). [2]
  • jsDelivr listing for nitro v3 alpha. [3]

Replace nitro-nightly with stable version in example project.

Using nitro-nightly@latest in example projects introduces instability risk as nightly builds can contain breaking changes or bugs. Examples are user-facing code references and should use stable versions. The latest stable release is v2.12.5 via the nitropack package (or use the stable nitro package if available).

🤖 Prompt for AI Agents
In @examples/react/start-basic/package.json at line 27, The package.json uses an
unstable dependency mapping ("nitro": "npm:nitro-nightly@latest"); update the
"nitro" entry to point to the stable release instead (for example use "nitro":
"npm:nitropack@2.12.5" or the official stable "nitro" package at the
corresponding stable version) so the example project depends on a stable nitro
release rather than the nightly build.

import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
import viteSolid from 'vite-plugin-solid'
import tailwindcss from '@tailwindcss/vite'
import { nitro } from 'nitro/vite'
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 | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n examples/solid/start-basic/vite.config.ts

Repository: TanStack/router

Length of output: 709


🌐 Web query:

Nitro Vite plugin ordering placement requirements documentation

💡 Result:

Short answer: Nitro's Vite plugin just needs to be included in your Vite config's plugins array; there is no formal, rigid "must-be-last" ordering rule in the official Nitro docs — placement is driven by your app's needs and other plugins (examples place nitro alongside or after framework plugins). See these docs/examples:

  • Nitro Vite plugin / Nitro v3 docs (usage & integration examples). [1]
  • @analogjs / vite-plugin-nitro docs (install + "add to plugins array" examples). [2]
  • Example placements in ecosystem docs (TanStack / Solid/React examples showing nitro placed with other plugins). [3]

If you want, tell me which Vite plugins/framework you use (Vue/React/Solid, SSR plugins, TanStack, etc.) and I’ll recommend the safest placement for your config and any ordering gotchas.


🌐 Web query:

TanStack Solid Start vite.config nitro plugin ordering best practices

💡 Result:

Short best-practices for Vite plugin ordering when using TanStack Solid Start + Nitro

Recommended minimal ordering (left-to-right in plugins array):

  • tsconfig paths / static tooling (vite-tsconfig-paths, tailwindcss, etc.).
  • tanstackStart() / @tanstack/solid-start plugin.
  • nitro() (or @tanstack/nitro-v2-vite-plugin when using the TanStack wrapper/workarounds).
  • vite-plugin-solid({ ssr: true }) (Solid compiler last so it sees the SSR build graph).

Why:

  • tanstackStart integrates Start’s multi-router Vite hooks and should run before Nitro so it can shape the build inputs. [1][2]
  • nitro’s vite plugin integrates Vite’s SSR environment and must come before the Solid SSR compiler so Nitro can control SSR-specific resolve/externals and environment options. The docs show nitro() placed before vite-plugin-solid(). [1][2]
  • vite-plugin-solid should be last (with ssr: true) so it compiles Solid components after other plugins (routing, nitro) have adjusted the module graph. [1][4]

Other practical tips

  • Add nitro: {} to your Vite config (Start docs/examples show this). [1][2]
  • If using TanStack’s nitro-v2 wrapper or nitro-nightly in containers, prefer the plugin recommended by TanStack and watch for Nitro v3 incompatibilities (many use v2/nightly as a practical workaround). Test builds in your target environment. [3][6]
  • If you need plugin-specific ordering (e.g., env/resolve transforms, Cloudflare or adapter plugins), place adapter-specific plugins after tanstackStart but before vite-plugin-solid, and test dev vs build (some dev-only errors appear depending on plugin order). See community issues where ordering causes SSR/dev errors. [0][3]
  • When in doubt: replicate the ordering from official examples (tanstackStart(), nitro(), vite-plugin-solid({ ssr: true })) and iterate only if you hit a concrete build/runtime error; open an issue with a minimal repro if behavior is unexpected. [1][2]

Example snippet (Vite plugins array)
import { tanstackStart } from '@tanstack/solid-start/plugin/vite'
import { nitro } from 'nitro/vite'
import viteSolid from 'vite-plugin-solid'
export default defineConfig({
plugins: [
tsConfigPaths(),
tanstackStart(),
nitro(),
viteSolid({ ssr: true }),
],
nitro: {},
})

Sources

  • TanStack Start hosting / Vite + Nitro examples. [1]
  • Solid Start defineConfig / vite option docs (router-aware Vite config). [2]
  • Community reports and Nitro v2/v3 notes (issues / Q&A referencing nitro-nightly and nitro-v2 plugin). [3][6]

References
[1] TanStack Start (Solid) Hosting / Vite + Nitro examples.
[2] Solid Start defineConfig (Vite configuration and router-aware hooks).
[3] Community Q&A / StackOverflow: nitro-nightly / nitro-v2 usage with TanStack Start.
[6] TanStack discussion about Nitro v3 compatibility and nitro-v2 workaround.


Move the Nitro plugin before vite-plugin-solid in the plugins array.

According to TanStack/Nitro best practices, the plugin order should be: static tooling → tanstackStart() → nitro() → viteSolid({ ssr: true }). Nitro must run before the Solid SSR compiler so it can control SSR-specific resolve/externals and environment options. The Solid plugin should be last in the chain to compile components after other plugins have shaped the module graph.

Correct plugin order
plugins: [
  tailwindcss(),
  tsConfigPaths({
    projects: ['./tsconfig.json'],
  }),
  tanstackStart(),
  nitro(),
  viteSolid({ ssr: true }),
],
🤖 Prompt for AI Agents
In @examples/solid/start-basic/vite.config.ts at line 6, The plugins array
currently runs viteSolid before the Nitro plugin; reorder the plugins so nitro()
appears before viteSolid({ ssr: true }) and after tanstackStart(), following the
required sequence (static tooling → tanstackStart() → nitro() → viteSolid({ ssr:
true)); adjust the import/use of nitro from 'nitro/vite' accordingly and ensure
tanstackStart() remains before nitro() and viteSolid is last.

@schiller-manuel schiller-manuel merged commit e93a4c3 into main Jan 8, 2026
6 checks passed
@schiller-manuel schiller-manuel deleted the basic-examples branch January 8, 2026 21:48
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