Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/trim-start-meta-reexports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@tanstack/react-start': patch
'@tanstack/solid-start': patch
'@tanstack/vue-start': patch
---

Explicitly re-export public API names from `@tanstack/start-client-core` (`createServerFn`, `createMiddleware`, `createStart`, `createCsrfMiddleware`, `createIsomorphicFn`, `createClientOnlyFn`, `createServerOnlyFn`) alongside the existing `export *`. The explicit named re-exports are registered at link time (via Vite SSR's `defineExport` at `fileStartIndex`), so the namespace has these getters before any import body runs — survives the cold-start SSR cycle through user middleware where `export *` would otherwise produce a partial facade (`createMiddleware is not a function`). Workaround for vitejs/vite#22491 / #22493.
16 changes: 15 additions & 1 deletion packages/react-start/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
export { useServerFn } from './useServerFn'
export * from '@tanstack/start-client-core'
export { createServerFn } from '@tanstack/start-client-core'
// Explicit re-exports shadow `export *` above so these public-API names are
// registered on the namespace at link time (via Vite SSR's `defineExport`
// at fileStartIndex), surviving the cold-start SSR cycle through user
// middleware. See vitejs/vite#22491 / #22493. Trim list to genuine public
// API only; internals fall through `export *` and are safe because they
// aren't imported at top level in the cycle path.
export {
createClientOnlyFn,
createCsrfMiddleware,
createIsomorphicFn,
createMiddleware,
createServerFn,
createServerOnlyFn,
createStart,
} from '@tanstack/start-client-core'
export { Hydrate } from '@tanstack/react-start-client'
export type {
HydrateOptions,
Expand Down
15 changes: 15 additions & 0 deletions packages/solid-start/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
export { useServerFn } from './useServerFn'
export * from '@tanstack/start-client-core'
// Explicit re-exports shadow `export *` above so these public-API names are
// registered on the namespace at link time (via Vite SSR's `defineExport`
// at fileStartIndex), surviving the cold-start SSR cycle through user
// middleware. See vitejs/vite#22491 / #22493. Trim list to genuine public
// API only; internals fall through `export *` and are safe because they
// aren't imported at top level in the cycle path.
export {
createClientOnlyFn,
createCsrfMiddleware,
createIsomorphicFn,
createMiddleware,
createServerFn,
createServerOnlyFn,
createStart,
} from '@tanstack/start-client-core'
export { Hydrate } from '@tanstack/solid-start-client'
export type {
HydrateOptions,
Expand Down
15 changes: 15 additions & 0 deletions packages/vue-start/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
export { useServerFn } from './useServerFn'
export * from '@tanstack/start-client-core'
// Explicit re-exports shadow `export *` above so these public-API names are
// registered on the namespace at link time (via Vite SSR's `defineExport`
// at fileStartIndex), surviving the cold-start SSR cycle through user
// middleware. See vitejs/vite#22491 / #22493. Trim list to genuine public
// API only; internals fall through `export *` and are safe because they
// aren't imported at top level in the cycle path.
export {
createClientOnlyFn,
createCsrfMiddleware,
createIsomorphicFn,
createMiddleware,
createServerFn,
createServerOnlyFn,
createStart,
} from '@tanstack/start-client-core'
Loading