diff --git a/docs/start/framework/react/guide/server-entry-point.md b/docs/start/framework/react/guide/server-entry-point.md index a07014947e..e1f428754d 100644 --- a/docs/start/framework/react/guide/server-entry-point.md +++ b/docs/start/framework/react/guide/server-entry-point.md @@ -100,3 +100,19 @@ The server entry point is where you can configure server-specific behavior: - Logging and monitoring This flexibility allows you to customize how your TanStack Start application handles server-side rendering while maintaining the framework's conventions. + +## Configuring the Server Entry Point + +When deploying to platforms like Cloudflare Workers or other edge runtimes, you need to configure where your custom server entry point is located. + +### Cloudflare Workers + +Update your `wrangler.jsonc` to point to your custom server entry point: + +```jsonc +{ + "main": "./src/server.ts" +} +``` + +This tells Cloudflare Workers to use your custom `src/server.ts` file as the entry point instead of the default TanStack Start handler. It is essential when you need custom middleware, authentication, or other server-side logic (such as i18n middleware for locale handling). diff --git a/examples/react/start-i18n-paraglide/README.md b/examples/react/start-i18n-paraglide/README.md index 7f481e133c..421c2390ef 100644 --- a/examples/react/start-i18n-paraglide/README.md +++ b/examples/react/start-i18n-paraglide/README.md @@ -86,6 +86,8 @@ export default { } ``` +> **Important**: A custom `server.ts` entry point is required for Paraglide to work correctly. It handles locale detection from URLs, server-side rendering context. See the [Server Entry Point documentation](https://tanstack.com/start/latest/docs/framework/react/guide/server-entry-point) for setup instructions on different platforms, including Cloudflare Workers. + In `__root.tsx` change the html lang attribute to the current locale. ```tsx