-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Which project does this relate to?
Start
Describe the bug
After upgrading from @tanstack/react-start@1.167.5 to 1.167.6, TypeScript cannot resolve types for the @tanstack/react-start/server-entry module:
error TS7016: Could not find a declaration file for module '@tanstack/react-start/server-entry'.
The package.json exports map points to:
"./server-entry": {
"import": {
"types": "./dist/default-entry/esm/server.d.ts",
"default": "./dist/default-entry/esm/server.js"
}
}But server.d.ts does not exist at that path. It was emitted at a nested path instead:
dist/default-entry/esm/src/default-entry/server.d.ts <-- actual
dist/default-entry/esm/server.d.ts <-- expected by exports map
This was introduced by #7024 (upgrade tooling to TypeScript 6). That PR added explicit rootDir: "./src" via tsconfig.build.json across packages, but the server-entry build (vite.config.server-entry.ts) likely didn't get the matching config, causing the declaration output to preserve the src/default-entry/ directory nesting.
1.167.5 has server.d.ts at the correct path. 1.167.6 does not.
Your Example Website or App
N/A — reproducible by installing @tanstack/react-start@1.167.6 and running tsc --noEmit on the documented server entry pattern.
Steps to Reproduce the Bug or Issue
- Install
@tanstack/react-start@1.167.6 - Use the documented server entry pattern from https://tanstack.com/start/latest/docs/framework/react/guide/server-entry-point
- Run
tsc --noEmit(ortsgo --noEmit) - TS7016 error on the
@tanstack/react-start/server-entryimport
Expected behavior
TypeScript resolves types for @tanstack/react-start/server-entry as it does in 1.167.5, where dist/default-entry/esm/server.d.ts exists at the path declared in the exports map.
Screenshots or Videos
No response
Platform
- Router / Start Version: 1.167.6 (works on 1.167.5)
- OS: macOS
- Browser: N/A (build-time issue)
- Browser Version: N/A
- Bundler: Vite 8
- Bundler Version: 8.0.2
Additional context
Likely fix: update vite.config.server-entry.ts to reference tsconfig.build.json (with rootDir: "./src") so declaration output lands at dist/default-entry/esm/server.d.ts instead of dist/default-entry/esm/src/default-entry/server.d.ts. PR #7024 did this for the main vite config but appears to have missed the server-entry config.
Workaround: pin to 1.167.5.