diff --git a/docs/start/framework/react/build-from-scratch.md b/docs/start/framework/react/build-from-scratch.md index a0a04f06d4..6f099115c1 100644 --- a/docs/start/framework/react/build-from-scratch.md +++ b/docs/start/framework/react/build-from-scratch.md @@ -39,13 +39,16 @@ We highly recommend using TypeScript with TanStack Start. Create a `tsconfig.jso "module": "ESNext", "target": "ES2022", "skipLibCheck": true, - "strictNullChecks": true + "strictNullChecks": true, + "verbatimModuleSyntax": false } } ``` > [!NOTE] -> Enabling `verbatimModuleSyntax` can result in server bundles leaking into client bundles. It is recommended to keep this option disabled. +> Enabling `verbatimModuleSyntax` can result in server-only code leaking into client bundles when types are imported from modules that also contain server-only code. It is recommended to keep this option disabled. +> +> TypeScript's compiler default is still `false`, but `tsc --init` (TypeScript 5.9+ and 6.0) generates `"verbatimModuleSyntax": true` as a recommended option. If you use `tsc --init`, explicitly set `"verbatimModuleSyntax": false` in your `tsconfig.json`. ## Install Dependencies diff --git a/docs/start/framework/solid/build-from-scratch.md b/docs/start/framework/solid/build-from-scratch.md index 5343f21e8b..7715079661 100644 --- a/docs/start/framework/solid/build-from-scratch.md +++ b/docs/start/framework/solid/build-from-scratch.md @@ -38,13 +38,16 @@ We highly recommend using TypeScript with TanStack Start. Create a `tsconfig.jso "module": "ESNext", "target": "ES2022", "skipLibCheck": true, - "strictNullChecks": true + "strictNullChecks": true, + "verbatimModuleSyntax": false } } ``` > [!NOTE] -> Enabling `verbatimModuleSyntax` can result in server bundles leaking into client bundles. It is recommended to keep this option disabled. +> Enabling `verbatimModuleSyntax` can result in server-only code leaking into client bundles when types are imported from modules that also contain server-only code. It is recommended to keep this option disabled. +> +> TypeScript's compiler default is still `false`, but `tsc --init` (TypeScript 5.9+ and 6.0) generates `"verbatimModuleSyntax": true` as a recommended option. If you use `tsc --init`, explicitly set `"verbatimModuleSyntax": false` in your `tsconfig.json`. ## Install Dependencies diff --git a/examples/react/start-counter/tsconfig.json b/examples/react/start-counter/tsconfig.json index cef9369516..22ce35b408 100644 --- a/examples/react/start-counter/tsconfig.json +++ b/examples/react/start-counter/tsconfig.json @@ -10,6 +10,7 @@ "isolatedModules": true, "resolveJsonModule": true, "skipLibCheck": true, + "verbatimModuleSyntax": false, "target": "ES2022", "allowJs": true, "forceConsistentCasingInFileNames": true, diff --git a/examples/solid/start-counter/tsconfig.json b/examples/solid/start-counter/tsconfig.json index 508ace2e17..fdee488ec1 100644 --- a/examples/solid/start-counter/tsconfig.json +++ b/examples/solid/start-counter/tsconfig.json @@ -11,6 +11,7 @@ "isolatedModules": true, "resolveJsonModule": true, "skipLibCheck": true, + "verbatimModuleSyntax": false, "target": "ES2022", "allowJs": true, "forceConsistentCasingInFileNames": true, diff --git a/packages/start-client-core/skills/start-core/SKILL.md b/packages/start-client-core/skills/start-core/SKILL.md index 82481417bc..0b2f5fe543 100644 --- a/packages/start-client-core/skills/start-core/SKILL.md +++ b/packages/start-client-core/skills/start-core/SKILL.md @@ -172,7 +172,7 @@ plugins: [tanstackStart(), react()] ### 2. HIGH: Enabling verbatimModuleSyntax in tsconfig -`verbatimModuleSyntax` causes server bundles to leak into client bundles. Keep it disabled. +`verbatimModuleSyntax` causes server bundles to leak into client bundles. Keep it disabled. TypeScript's compiler default is still `false`, but `tsc --init` (TypeScript 5.9+ and 6.0) generates `"verbatimModuleSyntax": true` — explicitly set `"verbatimModuleSyntax": false` in `tsconfig.json`. ### 3. HIGH: Missing Scripts component in root route