Skip to content

fix(start): import Register from @tanstack/router-core in default server entry - #8194

Open
rajat12826 wants to merge 1 commit into
TanStack:mainfrom
rajat12826:main
Open

fix(start): import Register from @tanstack/router-core in default server entry#8194
rajat12826 wants to merge 1 commit into
TanStack:mainfrom
rajat12826:main

Conversation

@rajat12826

@rajat12826 rajat12826 commented Aug 30, 2026

Copy link
Copy Markdown

Fixes #8186

Summary

TypeScript 7's "owning-package" rule requires module augmentations to target
the package that owns the interface declaration. The Register interface
is declared in @tanstack/router-core, but the default server entry files in
react-start, solid-start, and vue-start were importing it from the
framework-specific re-exports (@tanstack/react-router, etc.).

This forced users to write duplicate declare module augmentations for both
@tanstack/router-core and the framework router just to get
server.requestContext types working.

Changes

For each of react-start, solid-start, and vue-start:

  • src/default-entry/server.ts : Import Register from
    @tanstack/router-core instead of the framework router re-export.
  • package.json : Add @tanstack/router-core as a direct dependency
    (required for module resolution in the server-entry build).
  • vite.config.server-entry.ts : Add @tanstack/router-core to
    externalDeps so it is not bundled into the server-entry output.

Result

Users can now augment Register only in @tanstack/router-core and have it
work everywhere, including the generated server entry , no duplicate
augmentation needed. Fully backward compatible with existing dual augmentations.

In summary:
Import Register from @tanstack/router-core in default server entry to fix TypeScript 7 owning-package augmentation resolution

Summary by CodeRabbit

  • Bug Fixes
    • Improved server-entry compatibility across React, Solid, and Vue Start applications.
    • Updated server builds to correctly handle shared router functionality.
  • Refactor
    • Standardized server registration typing across framework integrations.
    • Improved dependency handling for consistent runtime behavior.

@coderabbitai

coderabbitai Bot commented Aug 30, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: acfa0dfc-e1d5-4407-a34d-b5e01fec3018

📥 Commits

Reviewing files that changed from the base of the PR and between 0caf6b9 and 776965f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • packages/react-start/package.json
  • packages/react-start/src/default-entry/server.ts
  • packages/react-start/vite.config.server-entry.ts
  • packages/solid-start/package.json
  • packages/solid-start/src/default-entry/server.ts
  • packages/solid-start/vite.config.server-entry.ts
  • packages/vue-start/package.json
  • packages/vue-start/src/default-entry/server.ts
  • packages/vue-start/vite.config.server-entry.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

React Start, Solid Start, and Vue Start now use Register from @tanstack/router-core. Each package declares the dependency and externalizes it in the server-entry Vite configuration.

Changes

Start server-entry integration

Layer / File(s) Summary
Register type wiring
packages/{react,solid,vue}-start/package.json, packages/{react,solid,vue}-start/src/default-entry/server.ts
The three Start packages add @tanstack/router-core and import Register from it.
Server build externalization
packages/{react,solid,vue}-start/vite.config.server-entry.ts
The three server-entry Vite configurations externalize @tanstack/router-core.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 77696

This localized change updates the server-entry type import and declares the owning package directly across the React, Solid, and Vue integrations; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: importing Register from @tanstack/router-core in the default server entry. It is concise and relevant.
Description check ✅ Passed The description clearly explains the motivation, affected packages, dependency changes, Vite externalization, and expected result. It does not reproduce the template's Checklist and Release Impact hea…
Linked Issues check ✅ Passed The changes satisfy issue #8186. All three Start packages now import Register from @tanstack/router-core, declare it as a direct dependency, and externalize it in the server-entry Vite configuration. …
Out of Scope Changes check ✅ Passed All reviewed changes support the linked issue objectives. No unrelated code or configuration changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6…
Full details: Description check

Explanation

The description clearly explains the motivation, affected packages, dependency changes, Vite externalization, and expected result. It does not reproduce the template's Checklist and Release Impact headings, but it is otherwise mostly complete and directly relevant.

Full details: Linked Issues check

Explanation

The changes satisfy issue #8186. All three Start packages now import Register from @tanstack/router-core, declare it as a direct dependency, and externalize it in the server-entry Vite configuration. This addresses the TypeScript 7 owning-package augmentation requirement.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6 files. (3 skipped: 3 unsupported.)

✨ 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.

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.

TypeScript 7 still requires duplicate Register augmentation for Start server-entry context

1 participant