Skip to content

docs(start): clarify verbatimModuleSyntax must be disabled#7806

Open
galaxykhh wants to merge 1 commit into
TanStack:mainfrom
galaxykhh:docs/verbatim-module-syntax-ts6
Open

docs(start): clarify verbatimModuleSyntax must be disabled#7806
galaxykhh wants to merge 1 commit into
TanStack:mainfrom
galaxykhh:docs/verbatim-module-syntax-ts6

Conversation

@galaxykhh

@galaxykhh galaxykhh commented Jul 13, 2026

Copy link
Copy Markdown

Summary

  • Update the React and Solid Build from Scratch guides to explicitly set "verbatimModuleSyntax": false in the example tsconfig.json
  • Clarify that TypeScript's compiler default is still false, while tsc --init (TypeScript 5.9+ and 6.0) generates "verbatimModuleSyntax": true as a recommended option
  • Align the start-counter examples (linked from the React guide) and the Start core skill doc with the same guidance

Problem

The build-from-scratch guides warn that enabling verbatimModuleSyntax can cause server-only code to leak into client bundles, but they:

  1. Do not show how to disable it in the example tsconfig.json
  2. Do not mention that tsc --init now generates "verbatimModuleSyntax": true (tsc --init update microsoft/TypeScript#61813)

This is especially relevant for TypeScript 6 users who run tsc --init before following the guide, since the generated config opts into verbatimModuleSyntax even though the compiler default remains false.

Changes

File Change
docs/start/framework/react/build-from-scratch.md Add "verbatimModuleSyntax": false to example tsconfig; expand NOTE
docs/start/framework/solid/build-from-scratch.md Same
examples/react/start-counter/tsconfig.json Add "verbatimModuleSyntax": false
examples/solid/start-counter/tsconfig.json Same
packages/start-client-core/skills/start-core/SKILL.md Mention tsc --init behavior

Test plan

  • Docs-only change; no runtime code modified
  • Verified example tsconfig.json files remain valid JSON
  • Reviewed rendered NOTE callout for clarity on tanstack.com docs preview (if applicable)

Summary by CodeRabbit

  • Documentation

    • Clarified TypeScript configuration requirements for TanStack Start projects.
    • Added guidance to explicitly set verbatimModuleSyntax to false, particularly when using tsc --init with newer TypeScript versions.
    • Updated React and Solid build guides and common-mistakes guidance.
  • Configuration

    • Updated the React and Solid counter examples to use the recommended TypeScript setting.

The build-from-scratch guides only said to keep `verbatimModuleSyntax`
disabled without showing how, and didn't mention that `tsc --init`
(TypeScript 5.9+ and 6.0) now generates `"verbatimModuleSyntax": true`.
Add `"verbatimModuleSyntax": false` to the example tsconfig and clarify
that the compiler default is still `false` while the init template
opts in.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 40b9e7b3-9d4e-42e7-b6af-e483265cbb87

📥 Commits

Reviewing files that changed from the base of the PR and between 41f7bf3 and 459f2de.

📒 Files selected for processing (5)
  • docs/start/framework/react/build-from-scratch.md
  • docs/start/framework/solid/build-from-scratch.md
  • examples/react/start-counter/tsconfig.json
  • examples/solid/start-counter/tsconfig.json
  • packages/start-client-core/skills/start-core/SKILL.md

📝 Walkthrough

Walkthrough

TanStack Start documentation and counter examples now explicitly configure verbatimModuleSyntax as false. The React and Solid guides, plus Start skills guidance, explain its incompatibility and clarify that tsc --init may generate it as true.

Changes

verbatimModuleSyntax configuration

Layer / File(s) Summary
Configuration guidance and examples
docs/start/framework/{react,solid}/build-from-scratch.md, examples/{react,solid}/start-counter/tsconfig.json, packages/start-client-core/skills/start-core/SKILL.md
Documentation and skills guidance explain the required setting, while both counter examples set verbatimModuleSyntax to false.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested labels: documentation

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: clarifying that verbatimModuleSyntax must be disabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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


> [!NOTE]
> Enabling `verbatimModuleSyntax` can result in server bundles leaking into client bundles. It is recommended to keep this option disabled.
> TanStack Start does not support `verbatimModuleSyntax` enabled — it can cause server-only code to leak into client bundles.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not that we dont "support" it. it can be used but could cause those leaks if types are imported from modules that have server only code

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