File tree Expand file tree Collapse file tree 3 files changed +16
-14
lines changed
packages/start-server-core/src Expand file tree Collapse file tree 3 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ export function createStartHandler<TRouter extends AnyRouter>({
106
106
const router = createRouter ( )
107
107
108
108
// Attach the server-side SSR utils to the client-side router
109
- attachRouterServerSsrUtils ( router , getStartManifest ( ) )
109
+ attachRouterServerSsrUtils ( router , await getStartManifest ( ) )
110
110
111
111
// Update the client-side router with the history and context
112
112
router . update ( {
Original file line number Diff line number Diff line change 1
- import { tsrStartManifest } from 'tanstack-start-router-manifest:v'
2
1
import { rootRouteId } from '@tanstack/router-core'
3
2
4
3
declare global {
@@ -12,7 +11,8 @@ declare global {
12
11
* special assets that are needed for the client. It does not include relationships
13
12
* between routes or any other data that is not needed for the client.
14
13
*/
15
- export function getStartManifest ( ) {
14
+ export async function getStartManifest ( ) {
15
+ const { tsrStartManifest } = await import ( 'tanstack-start-router-manifest:v' )
16
16
const startManifest = tsrStartManifest ( )
17
17
18
18
const rootRoute = ( startManifest . routes [ rootRouteId ] =
Original file line number Diff line number Diff line change 1
1
import { isNotFound } from '@tanstack/router-core'
2
2
import invariant from 'tiny-invariant'
3
3
import { startSerializer } from '@tanstack/start-client-core'
4
- // @ts -expect-error
5
- import _serverFnManifest from 'tanstack-start-server-fn-manifest:v'
6
4
import { getEvent , getResponseStatus } from './h3'
7
5
8
- const serverFnManifest = _serverFnManifest as Record <
9
- string ,
10
- {
11
- functionName : string
12
- extractedFilename : string
13
- importer : ( ) => Promise < any >
14
- }
15
- >
16
-
17
6
function sanitizeBase ( base : string | undefined ) {
18
7
if ( ! base ) {
19
8
throw new Error (
@@ -53,6 +42,19 @@ export const handleServerAction = async ({ request }: { request: Request }) => {
53
42
throw new Error ( 'Invalid server action param for serverFnId: ' + serverFnId )
54
43
}
55
44
45
+ const { default : _serverFnManifest } = await import (
46
+ // @ts -expect-error
47
+ 'tanstack-start-server-fn-manifest:v'
48
+ )
49
+
50
+ const serverFnManifest = _serverFnManifest as Record <
51
+ string ,
52
+ {
53
+ functionName : string
54
+ extractedFilename : string
55
+ importer : ( ) => Promise < any >
56
+ }
57
+ >
56
58
const serverFnInfo = serverFnManifest [ serverFnId ]
57
59
58
60
if ( ! serverFnInfo ) {
You can’t perform that action at this time.
0 commit comments