-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
examples: make basic runnable with nitro #6336
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ import tsConfigPaths from 'vite-tsconfig-paths' | |
| import { tanstackStart } from '@tanstack/solid-start/plugin/vite' | ||
| import viteSolid from 'vite-plugin-solid' | ||
| import tailwindcss from '@tailwindcss/vite' | ||
| import { nitro } from 'nitro/vite' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n examples/solid/start-basic/vite.config.tsRepository: TanStack/router Length of output: 709 🌐 Web query:
💡 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:
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:
💡 Result: Short best-practices for Vite plugin ordering when using TanStack Solid Start + Nitro Recommended minimal ordering (left-to-right in plugins array):
Why:
Other practical tips
Example snippet (Vite plugins array) Sources
References 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 orderplugins: [
tailwindcss(),
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
tanstackStart(),
nitro(),
viteSolid({ ssr: true }),
],🤖 Prompt for AI Agents |
||
|
|
||
| export default defineConfig({ | ||
| server: { | ||
|
|
@@ -15,5 +16,6 @@ export default defineConfig({ | |
| }), | ||
| tanstackStart(), | ||
| viteSolid({ ssr: true }), | ||
| nitro(), | ||
| ], | ||
| }) | ||
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 executed:
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.jsonRepository: TanStack/router
Length of output: 947
🏁 Script executed:
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:
Replace nitro-nightly with stable version in example project.
Using
nitro-nightly@latestin 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 thenitropackpackage (or use the stablenitropackage if available).🤖 Prompt for AI Agents