-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
docs(examples): clarify server.ts entrypoint updates for edge runtimes #6493
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
base: main
Are you sure you want to change the base?
docs(examples): clarify server.ts entrypoint updates for edge runtimes #6493
Conversation
📝 WalkthroughWalkthroughDocumentation updates to the Paraglide React i18n example's README, covering edge-runtime deployment guidance for Cloudflare Workers, Vite plugin configuration with localization settings, server entrypoint considerations for non-Node environments, and URL rewrite integration examples. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
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: 1
🤖 Fix all issues with AI agents
In `@examples/react/start-i18n-paraglide/README.md`:
- Around line 91-96: The README shows a JSON code block for wrangler.toml which
is invalid; replace the JSON block with a TOML code block and use TOML comment
syntax, e.g., change the block labelled **Cloudflare Workers (`wrangler.toml`)**
to use ```toml``` and set the entry as main = "./src/server.ts" with comments
prefixed by # (not //) so the file is valid TOML for Wrangler.
| **Cloudflare Workers (`wrangler.toml`):** | ||
| ```jsonc | ||
| { | ||
| "main": "./src/server.ts" // Instead of "main": "@tanstack/react-start/ | ||
| } | ||
| ``` |
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.
Incorrect file format: wrangler.toml requires TOML syntax, not JSON.
The code block shows JSON syntax, but wrangler.toml is a TOML configuration file. This will cause syntax errors during deployment.
📝 Proposed fix with correct TOML syntax
-**Cloudflare Workers (`wrangler.toml`):**
-```jsonc
-{
- "main": "./src/server.ts" // Instead of "main": "@tanstack/react-start/
-}
-```
+**Cloudflare Workers (`wrangler.toml`):**
+```toml
+# Instead of the default TanStack Start server entry
+main = "./src/server.ts"
+```📝 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.
| **Cloudflare Workers (`wrangler.toml`):** | |
| ```jsonc | |
| { | |
| "main": "./src/server.ts" // Instead of "main": "@tanstack/react-start/ | |
| } | |
| ``` | |
| **Cloudflare Workers (`wrangler.toml`):** |
🤖 Prompt for AI Agents
In `@examples/react/start-i18n-paraglide/README.md` around lines 91 - 96, The
README shows a JSON code block for wrangler.toml which is invalid; replace the
JSON block with a TOML code block and use TOML comment syntax, e.g., change the
block labelled **Cloudflare Workers (`wrangler.toml`)** to use ```toml``` and
set the entry as main = "./src/server.ts" with comments prefixed by # (not //)
so the file is valid TOML for Wrangler.
| } | ||
| ``` | ||
|
|
||
| > **Note**: When using `server.ts`, you need to update the server entrypoint for edge runtimes like Cloudflare Workers, Deno, or other non-Node.js environments. The `paraglideMiddleware` handles locale detection from URLs, server-side rendering context, and prevents locale redirect bugs (e.g., `/de` → `/en`). For standard Node.js deployments, TanStack Start's default handler may work without customization. |
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.
no the default entry point never works with paraglide. you always need server.ts entry point. we should just link to the server entry point doc page and there explain how to use it in cloudflare
PR updates the Paraglide example documentation to clarify server entrypoint requirements for edge runtime deployments.
Changes:
server.tsneeds to be updated for edge runtimesparaglideMiddlewareprevents locale redirect bugs (e.g.,/de→/en)Issue was also mention here, but never properly documented. #6268
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.