Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Nov 26, 2025

Reverts #5959

We need a replacement for event._res

Summary by CodeRabbit

  • Chores
    • Updated server core dependency to a newer version.
  • Bug Fixes
    • Improved robustness in response handling by adding null-safety checks to preserve status and status text when available and avoid errors when missing.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

Walkthrough

Updated h3 dependency version in start-server-core; getResponse now returns event._res (not event.res); response status and statusText accesses use optional chaining (response?.status, response?.statusText) across response-construction paths.

Changes

Cohort / File(s) Summary
Dependency update
packages/start-server-core/package.json
Changed h3 dependency from npm:h3@2.0.1-rc.5 to npm:h3@2.0.0-beta.5.
Response sourcing
packages/start-server-core/src/request-response.ts
getResponse() now returns event._res instead of event.res.
Defensive status handling
packages/start-server-core/src/server-functions-handler.ts
Replaced direct response.status / response.statusText accesses with optional chaining (response?.status, response?.statusText) in all Response construction paths (non-streaming, streaming, empty, and error flows).

Sequence Diagram(s)

sequenceDiagram
  participant Event as Event
  participant getResponse as getResponse()
  participant Handler as ServerFunctionsHandler
  participant Response as ResponseConstructor

  Note over Event,getResponse: New lookup uses internal field
  Event->>getResponse: call getResponse(event)
  getResponse-->>Event: return event._res

  Note over getResponse,Handler: Handler builds Response using returned object
  getResponse->>Handler: response (may be undefined)
  Handler->>Response: new Response(body, { status: response?.status, statusText: response?.statusText })
  Response-->>Handler: constructed Response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check places assuming event.res elsewhere — confirm event._res is the correct internal source and doesn’t break callers.
  • Verify compatibility with the downgraded h3 version (APIs/shape of event object).
  • Ensure optional chaining preserves intended fallback behaviors (status defaults in error paths).

Possibly related PRs

Poem

🐰 I dug a tiny patch today,
I swapped a field and paved the way,
Optional chains keep status kind,
A softer hop for state and mind,
Beta blooms bright where RC lay.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references the h3 version bump but doesn't capture the main changes: reverting to an older h3 version and related code adjustments to use event._res.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-5959-chore--bump-h3-v2-to-2.0.1-rc.5

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d239a20 and b2e6482.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • packages/start-server-core/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/start-server-core/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Preview
  • GitHub Check: Test

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 and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Nov 26, 2025

View your CI Pipeline Execution ↗ for commit b2e6482

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 11m 59s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 39s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-26 14:38:35 UTC

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 64500ef and d239a20.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • packages/start-server-core/package.json (1 hunks)
  • packages/start-server-core/src/request-response.ts (1 hunks)
  • packages/start-server-core/src/server-functions-handler.ts (4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Use workspace protocol for internal dependencies (workspace:*)

Files:

  • packages/start-server-core/package.json
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode with extensive type safety throughout the codebase

Files:

  • packages/start-server-core/src/request-response.ts
  • packages/start-server-core/src/server-functions-handler.ts
🧠 Learnings (4)
📚 Learning: 2025-11-25T00:18:21.258Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T00:18:21.258Z
Learning: Applies to packages/solid-router/**/*.{ts,tsx} : Solid Router components and primitives should use the tanstack/solid-router package

Applied to files:

  • packages/start-server-core/package.json
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.

Applied to files:

  • packages/start-server-core/package.json
📚 Learning: 2025-11-25T00:18:21.258Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T00:18:21.258Z
Learning: Applies to packages/react-router/**/*.{ts,tsx} : React Router components and hooks should use the tanstack/react-router package

Applied to files:

  • packages/start-server-core/package.json
📚 Learning: 2025-11-25T00:18:21.257Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T00:18:21.257Z
Learning: Applies to **/package.json : Use workspace protocol for internal dependencies (workspace:*)

Applied to files:

  • packages/start-server-core/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test
  • GitHub Check: Preview
🔇 Additional comments (2)
packages/start-server-core/src/server-functions-handler.ts (1)

186-266: I'll begin by verifying the review comment about optional chaining on the response object. Let me start by examining the actual code changes in the file.
<function_calls>

#!/bin/bash

Read the file to verify the code changes

wc -l packages/start-server-core/src/server-functions-handler.ts


</function_calls>
<function_calls>

#!/bin/bash

Read lines 186-266 of the file

sed -n '186,266p' packages/start-server-core/src/server-functions-handler.ts | cat -n


</function_calls>
<function_calls>

#!/bin/bash

Also check lines around 302-305 mentioned in "Also applies to"

sed -n '300,310p' packages/start-server-core/src/server-functions-handler.ts | cat -n


</function_calls>
<function_calls>

#!/bin/bash

Find the getResponse function definition

rg -n 'function getResponse|const getResponse|getResponse\s*=' packages/start-server-core/src/server-functions-handler.ts -A 3


</function_calls>
<function_calls>

#!/bin/bash

Search for getResponse definition more broadly

rg -n 'getResponse' packages/start-server-core/src/server-functions-handler.ts | head -20


</function_calls>
<function_calls>

#!/bin/bash

Get context around where getResponse is assigned/defined

sed -n '1,200p' packages/start-server-core/src/server-functions-handler.ts | rg -n 'getResponse' -B 5 -A 5


</function_calls>
<function_calls>

#!/bin/bash

Let me read the beginning of the file to understand structure

head -100 packages/start-server-core/src/server-functions-handler.ts | cat -n


</function_calls>
<function_calls>

#!/bin/bash

Search for all occurrences of getResponse in context

rg -n 'getResponse' packages/start-server-core/src/server-functions-handler.ts -B 2 -A 2


</function_calls>

Now let me test the Node.js runtime behavior for the Response constructor with undefined status/statusText as suggested in the review:
<function_calls>

#!/bin/bash

Quick runtime probe for status/statusText defaults in Node.

node - <<'EOF'
const r1 = new Response(null, {});
const r2 = new Response(null, { status: undefined });
const r3 = new Response(null, { statusText: undefined });
console.log({
r1: { status: r1.status, statusText: r1.statusText },
r2: { status: r2.status, statusText: r2.statusText },
r3: { status: r3.status, statusText: r3.statusText }
});
EOF


</function_calls>

Let me also search for the full context of how response is being used and where it comes from:
<function_calls>

#!/bin/bash

Read a broader section around line 186-266 to see full context

sed -n '160,320p' packages/start-server-core/src/server-functions-handler.ts | cat -n


</function_calls>

Let me wait for the script results to better understand the context and verification needs.
packages/start-server-core/package.json (1)

78-85: h3-v2 pin correctly targets beta.4 for internal event._res access; workspace dependencies properly configured

The dependency change to h3-v2: "npm:h3@2.0.0-beta.4" is intentional and justified. The h3 2.0.0-rc and later releases hide event._res as internal, while beta.4 still exposes it—enabling the getResponse() function at packages/start-server-core/src/request-response.ts:330. Git history confirms this pin was deliberately reverted from rc.5, indicating a known trade-off.

All internal @tanstack/* dependencies correctly use the workspace:* protocol as per guidelines. Note: this is the only h3 reference in the monorepo (no multi-package version consistency concern).

Comment on lines 327 to 331
// not public API
export function getResponse() {
const event = getH3Event()
return event.res
return event._res
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Script executed:

#!/bin/bash
# Locate and read the request-response.ts file around the target lines
fd -t f "request-response.ts" packages/start-server-core/src

# Get file stats to understand size
wc -l packages/start-server-core/src/request-response.ts

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

stdout:

packages/start-server-core/src/request-response.ts
338 packages/start-server-core/src/request-response.ts

</shell_result>


Script executed:

#!/bin/bash
# Read the relevant section of the file
sed -n '320,338p' packages/start-server-core/src/request-response.ts

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

stdout:

 * Clear the session data for the current request.
 */
export function clearSession(config: Partial<SessionConfig>): Promise<void> {
  const event = getH3Event()
  return h3_clearSession(event, { name: 'start', ...config })
}

// not public API
export function getResponse() {
  const event = getH3Event()
  return event._res
}

// not public API (yet)
export function getValidatedQuery<TSchema extends StandardSchemaV1>(
  schema: StandardSchemaV1,
): Promise<StandardSchemaV1.InferOutput<TSchema>> {
  return h3_getValidatedQuery(getH3Event(), schema)
}

</shell_result>


Script executed:

#!/bin/bash
# Check h3 version in package.json
fd -t f "package.json" packages/start-server-core | head -1 | xargs cat | grep -A 5 -B 5 '"h3"'

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 1

</shell_result>


Script executed:

#!/bin/bash
# Search for h3 version across all package.json files
find . -name "package.json" -type f | xargs grep -l '"h3"' | head -5

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

</shell_result>


Script executed:

#!/bin/bash
# Search for getResponse() function calls
rg -n "getResponse\(" packages/start-server-core/ --type ts

echo "---"

# Search for event._res usages
rg -n "event\._res" . --type ts

echo "---"

# Search for h3 imports to understand the version
rg -n "from.*['\"]h3['\"]" . --type ts | head -20

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

stdout:

packages/start-server-core/src/server-functions-handler.ts:186:      const response = getResponse()
packages/start-server-core/src/server-functions-handler.ts:302:      const response = getResponse()
packages/start-server-core/src/request-response.ts:328:export function getResponse() {
---
./packages/start-server-core/src/request-response.ts:330:  return event._res
---
./packages/nitro-v2-vite-plugin/src/index.ts:123:                  [virtualEntry]: `import { fromWebHandler } from 'h3'

</shell_result>


Script executed:

#!/bin/bash
# Read server-functions-handler.ts around line 186 and 302 to see how getResponse() is used
echo "=== Around line 186 ==="
sed -n '180,192p' packages/start-server-core/src/server-functions-handler.ts

echo -e "\n=== Around line 302 ==="
sed -n '296,308p' packages/start-server-core/src/server-functions-handler.ts

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

stdout:

=== Around line 186 ===
      // }

      if (isNotFound(result)) {
        return isNotFoundResponse(result)
      }

      const response = getResponse()
      let nonStreamingBody: any = undefined

      if (result !== undefined) {
        // first run without the stream in case `result` does not need streaming
        let done = false as boolean
        const callbacks: {

=== Around line 302 ===
          toCrossJSONAsync(error, {
            refs: new Map(),
            plugins: serovalPlugins,
          }),
        ),
      )
      const response = getResponse()
      return new Response(serializedError, {
        status: response?.status ?? 500,
        statusText: response?.statusText,
        headers: {
          'Content-Type': 'application/json',
          [X_TSS_SERIALIZED]: 'true',

</shell_result>


Script executed:

#!/bin/bash
# Search for setResponseStatus and status manipulation
rg -n "setResponseStatus\|event\.res\|event\._res" packages/start-server-core/src/request-response.ts -A 2 -B 2

echo -e "\n=== Full request-response.ts for context ==="
cat -n packages/start-server-core/src/request-response.ts

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

stdout:


=== Full request-response.ts for context ===
     1	import { AsyncLocalStorage } from 'node:async_hooks'
     2	
     3	import {
     4	  H3Event,
     5	  clearSession as h3_clearSession,
     6	  deleteCookie as h3_deleteCookie,
     7	  getRequestHost as h3_getRequestHost,
     8	  getRequestIP as h3_getRequestIP,
     9	  getRequestProtocol as h3_getRequestProtocol,
    10	  getRequestURL as h3_getRequestURL,
    11	  getSession as h3_getSession,
    12	  getValidatedQuery as h3_getValidatedQuery,
    13	  parseCookies as h3_parseCookies,
    14	  sanitizeStatusCode as h3_sanitizeStatusCode,
    15	  sanitizeStatusMessage as h3_sanitizeStatusMessage,
    16	  sealSession as h3_sealSession,
    17	  setCookie as h3_setCookie,
    18	  toResponse as h3_toResponse,
    19	  unsealSession as h3_unsealSession,
    20	  updateSession as h3_updateSession,
    21	  useSession as h3_useSession,
    22	} from 'h3-v2'
    23	import type {
    24	  RequestHeaderMap,
    25	  RequestHeaderName,
    26	  ResponseHeaderMap,
    27	  ResponseHeaderName,
    28	  TypedHeaders,
    29	} from 'fetchdts'
    30	
    31	import type { CookieSerializeOptions } from 'cookie-es'
    32	import type {
    33	  Session,
    34	  SessionConfig,
    35	  SessionData,
    36	  SessionManager,
    37	  SessionUpdate,
    38	} from './session'
    39	import type { StandardSchemaV1 } from '@standard-schema/spec'
    40	import type { RequestHandler } from './request-handler'
    41	
    42	interface StartEvent {
    43	  h3Event: H3Event
    44	}
    45	const eventStorage = new AsyncLocalStorage<StartEvent>()
    46	
    47	export type { ResponseHeaderName, RequestHeaderName }
    48	
    49	export function requestHandler<TRegister = unknown>(
    50	  handler: RequestHandler<TRegister>,
    51	) {
    52	  return (request: Request, requestOpts: any): Promise<Response> | Response => {
    53	    const h3Event = new H3Event(request)
    54	
    55	    const response = eventStorage.run({ h3Event }, () =>
    56	      handler(request, requestOpts),
    57	    )
    58	    return h3_toResponse(response, h3Event)
    59	  }
    60	}
    61	
    62	function getH3Event() {
    63	  const event = eventStorage.getStore()
    64	  if (!event) {
    65	    throw new Error(
    66	      `No StartEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`,
    67	    )
    68	  }
    69	  return event.h3Event
    70	}
    71	
    72	export function getRequest(): Request {
    73	  const event = getH3Event()
    74	  return event.req
    75	}
    76	
    77	export function getRequestHeaders(): TypedHeaders<RequestHeaderMap> {
    78	  // TODO `as any` not needed when fetchdts is updated
    79	  return getH3Event().req.headers as any
    80	}
    81	
    82	export function getRequestHeader(name: RequestHeaderName): string | undefined {
    83	  return getRequestHeaders().get(name) || undefined
    84	}
    85	
    86	export function getRequestIP(opts?: {
    87	  /**
    88	   * Use the X-Forwarded-For HTTP header set by proxies.
    89	   *
    90	   * Note: Make sure that this header can be trusted (your application running behind a CDN or reverse proxy) before enabling.
    91	   */
    92	  xForwardedFor?: boolean
    93	}) {
    94	  return h3_getRequestIP(getH3Event(), opts)
    95	}
    96	
    97	/**
    98	 * Get the request hostname.
    99	 *
   100	 * If `xForwardedHost` is `true`, it will use the `x-forwarded-host` header if it exists.
   101	 *
   102	 * If no host header is found, it will default to "localhost".
   103	 */
   104	export function getRequestHost(opts?: { xForwardedHost?: boolean }) {
   105	  return h3_getRequestHost(getH3Event(), opts)
   106	}
   107	
   108	/**
   109	 * Get the full incoming request URL.
   110	 *
   111	 * If `xForwardedHost` is `true`, it will use the `x-forwarded-host` header if it exists.
   112	 *
   113	 * If `xForwardedProto` is `false`, it will not use the `x-forwarded-proto` header.
   114	 */
   115	export function getRequestUrl(opts?: {
   116	  xForwardedHost?: boolean
   117	  xForwardedProto?: boolean
   118	}) {
   119	  return h3_getRequestURL(getH3Event(), opts)
   120	}
   121	
   122	/**
   123	 * Get the request protocol.
   124	 *
   125	 * If `x-forwarded-proto` header is set to "https", it will return "https". You can disable this behavior by setting `xForwardedProto` to `false`.
   126	 *
   127	 * If protocol cannot be determined, it will default to "http".
   128	 */
   129	export function getRequestProtocol(opts?: {
   130	  xForwardedProto?: boolean
   131	}): 'http' | 'https' | (string & {}) {
   132	  return h3_getRequestProtocol(getH3Event(), opts)
   133	}
   134	
   135	export function setResponseHeaders(
   136	  headers: TypedHeaders<ResponseHeaderMap>,
   137	): void {
   138	  const event = getH3Event()
   139	  for (const [name, value] of Object.entries(headers)) {
   140	    event.res.headers.set(name, value)
   141	  }
   142	}
   143	
   144	export function getResponseHeaders(): TypedHeaders<ResponseHeaderMap> {
   145	  const event = getH3Event()
   146	  return event.res.headers
   147	}
   148	
   149	export function getResponseHeader(
   150	  name: ResponseHeaderName,
   151	): string | undefined {
   152	  const event = getH3Event()
   153	  return event.res.headers.get(name) || undefined
   154	}
   155	
   156	export function setResponseHeader(
   157	  name: ResponseHeaderName,
   158	  value: string | Array<string>,
   159	): void {
   160	  const event = getH3Event()
   161	  if (Array.isArray(value)) {
   162	    event.res.headers.delete(name)
   163	    for (const valueItem of value) {
   164	      event.res.headers.append(name, valueItem)
   165	    }
   166	  } else {
   167	    event.res.headers.set(name, value)
   168	  }
   169	}
   170	export function removeResponseHeader(name: ResponseHeaderName): void {
   171	  const event = getH3Event()
   172	  event.res.headers.delete(name)
   173	}
   174	
   175	export function clearResponseHeaders(
   176	  headerNames?: Array<ResponseHeaderName>,
   177	): void {
   178	  const event = getH3Event()
   179	  // If headerNames is provided, clear only those headers
   180	  if (headerNames && headerNames.length > 0) {
   181	    for (const name of headerNames) {
   182	      event.res.headers.delete(name)
   183	    }
   184	    // Otherwise, clear all headers
   185	  } else {
   186	    for (const name of event.res.headers.keys()) {
   187	      event.res.headers.delete(name)
   188	    }
   189	  }
   190	}
   191	
   192	export function getResponseStatus(): number {
   193	  return getH3Event().res.status || 200
   194	}
   195	
   196	export function setResponseStatus(code?: number, text?: string): void {
   197	  const event = getH3Event()
   198	  if (code) {
   199	    event.res.status = h3_sanitizeStatusCode(code, event.res.status)
   200	  }
   201	  if (text) {
   202	    event.res.statusText = h3_sanitizeStatusMessage(text)
   203	  }
   204	}
   205	
   206	/**
   207	 * Parse the request to get HTTP Cookie header string and return an object of all cookie name-value pairs.
   208	 * @returns Object of cookie name-value pairs
   209	 * ```ts
   210	 * const cookies = getCookies()
   211	 * ```
   212	 */
   213	export function getCookies(): Record<string, string> {
   214	  const event = getH3Event()
   215	  return h3_parseCookies(event)
   216	}
   217	
   218	/**
   219	 * Get a cookie value by name.
   220	 * @param name Name of the cookie to get
   221	 * @returns {*} Value of the cookie (String or undefined)
   222	 * ```ts
   223	 * const authorization = getCookie('Authorization')
   224	 * ```
   225	 */
   226	export function getCookie(name: string): string | undefined {
   227	  return getCookies()[name] || undefined
   228	}
   229	
   230	/**
   231	 * Set a cookie value by name.
   232	 * @param name Name of the cookie to set
   233	 * @param value Value of the cookie to set
   234	 * @param options {CookieSerializeOptions} Options for serializing the cookie
   235	 * ```ts
   236	 * setCookie('Authorization', '1234567')
   237	 * ```
   238	 */
   239	export function setCookie(
   240	  name: string,
   241	  value: string,
   242	  options?: CookieSerializeOptions,
   243	): void {
   244	  const event = getH3Event()
   245	  h3_setCookie(event, name, value, options)
   246	}
   247	
   248	/**
   249	 * Remove a cookie by name.
   250	 * @param name Name of the cookie to delete
   251	 * @param serializeOptions {CookieSerializeOptions} Cookie options
   252	 * ```ts
   253	 * deleteCookie('SessionId')
   254	 * ```
   255	 */
   256	export function deleteCookie(
   257	  name: string,
   258	  options?: CookieSerializeOptions,
   259	): void {
   260	  const event = getH3Event()
   261	  h3_deleteCookie(event, name, options)
   262	}
   263	
   264	function getDefaultSessionConfig(config: SessionConfig): SessionConfig {
   265	  return {
   266	    name: 'start',
   267	    ...config,
   268	  }
   269	}
   270	
   271	/**
   272	 * Create a session manager for the current request.
   273	 */
   274	export function useSession<TSessionData extends SessionData = SessionData>(
   275	  config: SessionConfig,
   276	): Promise<SessionManager<TSessionData>> {
   277	  const event = getH3Event()
   278	  return h3_useSession(event, getDefaultSessionConfig(config))
   279	}
   280	/**
   281	 * Get the session for the current request
   282	 */
   283	export function getSession<TSessionData extends SessionData = SessionData>(
   284	  config: SessionConfig,
   285	): Promise<Session<TSessionData>> {
   286	  const event = getH3Event()
   287	  return h3_getSession(event, getDefaultSessionConfig(config))
   288	}
   289	
   290	/**
   291	 * Update the session data for the current request.
   292	 */
   293	export function updateSession<TSessionData extends SessionData = SessionData>(
   294	  config: SessionConfig,
   295	  update?: SessionUpdate<TSessionData>,
   296	): Promise<Session<TSessionData>> {
   297	  const event = getH3Event()
   298	  return h3_updateSession(event, getDefaultSessionConfig(config), update)
   299	}
   300	
   301	/**
   302	 * Encrypt and sign the session data for the current request.
   303	 */
   304	export function sealSession(config: SessionConfig): Promise<string> {
   305	  const event = getH3Event()
   306	  return h3_sealSession(event, getDefaultSessionConfig(config))
   307	}
   308	/**
   309	 * Decrypt and verify the session data for the current request.
   310	 */
   311	export function unsealSession(
   312	  config: SessionConfig,
   313	  sealed: string,
   314	): Promise<Partial<Session>> {
   315	  const event = getH3Event()
   316	  return h3_unsealSession(event, getDefaultSessionConfig(config), sealed)
   317	}
   318	
   319	/**
   320	 * Clear the session data for the current request.
   321	 */
   322	export function clearSession(config: Partial<SessionConfig>): Promise<void> {
   323	  const event = getH3Event()
   324	  return h3_clearSession(event, { name: 'start', ...config })
   325	}
   326	
   327	// not public API
   328	export function getResponse() {
   329	  const event = getH3Event()
   330	  return event._res
   331	}
   332	
   333	// not public API (yet)
   334	export function getValidatedQuery<TSchema extends StandardSchemaV1>(
   335	  schema: StandardSchemaV1,
   336	): Promise<StandardSchemaV1.InferOutput<TSchema>> {
   337	  return h3_getValidatedQuery(getH3Event(), schema)
   338	}

</shell_result>


Script executed:

#!/bin/bash
# Search for h3-v2 or h3 in lock files or dependencies
find . -name "package-lock.json" -o -name "yarn.lock" -o -name "pnpm-lock.yaml" | head -1

# Check root package.json for h3-v2
cat package.json | grep -A 5 -B 5 "h3"

# Also check if there's a root packages directory listing
ls -la packages/ | head -20

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

stdout:

./pnpm-lock.yaml
total 0
drwxr-xr-x 37 jailuser jailuser 740 Nov 26 14:18 .
drwxr-xr-x 13 jailuser jailuser 720 Nov 26 14:20 ..
drwxr-xr-x  4 jailuser jailuser 160 Nov 26 14:18 arktype-adapter
drwxr-xr-x  4 jailuser jailuser 180 Nov 26 14:18 directive-functions-plugin
drwxr-xr-x  3 jailuser jailuser 160 Nov 26 14:18 eslint-plugin-router
drwxr-xr-x  4 jailuser jailuser 160 Nov 26 14:18 history
drwxr-xr-x  3 jailuser jailuser 160 Nov 26 14:18 nitro-v2-vite-plugin
drwxr-xr-x  4 jailuser jailuser 200 Nov 26 14:18 react-router
drwxr-xr-x  3 jailuser jailuser 160 Nov 26 14:18 react-router-devtools
drwxr-xr-x  3 jailuser jailuser 160 Nov 26 14:18 react-router-ssr-query
drwxr-xr-x  3 jailuser jailuser 180 Nov 26 14:18 react-start
drwxr-xr-x  3 jailuser jailuser 160 Nov 26 14:18 react-start-client
drwxr-xr-x  3 jailuser jailuser 160 Nov 26 14:18 react-start-server
drwxr-xr-x  4 jailuser jailuser 180 Nov 26 14:18 router-cli
drwxr-xr-x  4 jailuser jailuser 200 Nov 26 14:18 router-core
drwxr-xr-x  3 jailuser jailuser 160 Nov 26 14:18 router-devtools
drwxr-xr-x  4 jailuser jailuser 180 Nov 26 14:18 router-devtools-core
drwxr-xr-x  4 jailuser jailuser 200 Nov 26 14:18 router-generator
drwxr-xr-x  4 jailuser jailuser 180 Nov 26 14:18 router-plugin

</shell_result>


Script executed:

#!/bin/bash
# Check start-server-core package.json
echo "=== start-server-core package.json ==="
cat packages/start-server-core/package.json

echo -e "\n=== Root package.json ==="
head -50 package.json

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

stdout:

=== start-server-core package.json ===
{
  "name": "@tanstack/start-server-core",
  "version": "1.139.7",
  "description": "Modern and scalable routing for React applications",
  "author": "Tanner Linsley",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/TanStack/router.git",
    "directory": "packages/start-server-core"
  },
  "homepage": "https://tanstack.com/start",
  "funding": {
    "type": "github",
    "url": "https://github.com/sponsors/tannerlinsley"
  },
  "keywords": [
    "react",
    "location",
    "router",
    "routing",
    "async",
    "async router",
    "typescript"
  ],
  "scripts": {
    "clean": "rimraf ./dist && rimraf ./coverage",
    "test": "pnpm test:eslint && pnpm test:types && pnpm test:build && pnpm test:unit",
    "test:unit": "vitest",
    "test:eslint": "eslint ./src",
    "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"",
    "test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
    "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js",
    "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js",
    "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js",
    "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js",
    "test:types:ts59": "tsc",
    "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
    "build": "vite build"
  },
  "type": "module",
  "types": "dist/esm/index.d.ts",
  "exports": {
    ".": {
      "import": {
        "types": "./dist/esm/index.d.ts",
        "default": "./dist/esm/index.js"
      }
    },
    "./createServerRpc": {
      "import": {
        "types": "./dist/esm/createServerRpc.d.ts",
        "default": "./dist/esm/createServerRpc.js"
      }
    },
    "./createSsrRpc": {
      "import": {
        "types": "./dist/esm/createSsrRpc.d.ts",
        "default": "./dist/esm/createSsrRpc.js"
      }
    },
    "./package.json": "./package.json"
  },
  "imports": {
    "#tanstack-start-server-fn-manifest": {
      "default": "./dist/esm/fake-start-server-fn-manifest.js"
    }
  },
  "sideEffects": false,
  "files": [
    "dist",
    "src"
  ],
  "engines": {
    "node": ">=22.12.0"
  },
  "dependencies": {
    "@tanstack/history": "workspace:*",
    "@tanstack/router-core": "workspace:*",
    "@tanstack/start-client-core": "workspace:*",
    "@tanstack/start-storage-context": "workspace:*",
    "h3-v2": "npm:h3@2.0.0-beta.4",
    "seroval": "^1.4.0",
    "tiny-invariant": "^1.3.3"
  },
  "devDependencies": {
    "@standard-schema/spec": "^1.0.0",
    "cookie-es": "^2.0.0",
    "fetchdts": "^0.1.6"
  }
}

=== Root package.json ===
{
  "name": "root",
  "private": true,
  "repository": {
    "type": "git",
    "url": "https://github.com/TanStack/router.git"
  },
  "packageManager": "pnpm@10.13.1",
  "type": "module",
  "scripts": {
    "cleanNodeModules": "pnpm -r exec rm -rf node_modules",
    "clean": "pnpm --filter \"./packages/**\" run clean",
    "preinstall": "node -e \"if(process.env.CI == 'true') {console.info('Skipping preinstall...')} else {process.exit(1)}\" || npx -y only-allow pnpm",
    "test": "pnpm run test:ci",
    "test:pr": "nx affected --targets=test:eslint,test:unit,test:e2e,test:types,test:build,build",
    "test:ci": "nx run-many --targets=test:eslint,test:unit,test:e2e,test:types,test:build,build",
    "test:eslint": "nx affected --target=test:eslint --exclude=examples/**,e2e/**",
    "test:format": "pnpm run prettier --check",
    "test:unit": "nx affected --target=test:unit --exclude=examples/**,e2e/**",
    "test:unit:dev": "pnpm run test:unit && nx watch --all -- pnpm run test:unit",
    "test:build": "nx affected --target=test:build --exclude=examples/**",
    "test:types": "nx affected --target=test:types --exclude=examples/**",
    "test:e2e": "nx run-many --target=test:e2e",
    "build": "nx affected --target=build --exclude=e2e/** --exclude=examples/**",
    "build:all": "nx run-many --target=build --exclude=examples/** --exclude=e2e/**",
    "watch": "pnpm run build:all && nx watch --all -- pnpm run build:all",
    "dev": "pnpm run watch",
    "prettier": "prettier --experimental-cli --ignore-unknown '**/*'",
    "prettier:write": "pnpm run prettier --write",
    "cipublish": "node scripts/publish.js",
    "gpt-generate": "node gpt/generate.js",
    "set-ts-version": "node scripts/set-ts-version.js",
    "labeler-generate": "node scripts/generate-labeler-config.mjs",
    "cleanup-empty-packages": "node scripts/cleanup-empty-packages.mjs",
    "verify-links": "node scripts/verify-links.ts"
  },
  "devDependencies": {
    "@arethetypeswrong/cli": "^0.18.2",
    "@eslint-react/eslint-plugin": "^1.26.2",
    "@playwright/test": "^1.56.1",
    "@tanstack/config": "0.22.0",
    "@tanstack/react-query": "^5.90.7",
    "@tanstack/query-core": "^5.90.7",
    "@types/node": "22.10.2",
    "@types/react": "^19.2.2",
    "@types/react-dom": "^19.2.2",
    "@vitest/browser": "^3.0.6",
    "@vitest/ui": "^3.0.6",
    "eslint": "^9.22.0",
    "eslint-plugin-react-hooks": "^5.1.0",

</shell_result>


Script executed:

#!/bin/bash
# Search for H3Event import and type definition
echo "=== Searching for H3Event type definitions or usage ==="
rg -n "H3Event\|event\.res\|event\._res" packages/start-server-core/src/ -A 3 -B 1 | head -100

echo -e "\n=== Check how h3_toResponse is used ==="
sed -n '49,60p' packages/start-server-core/src/request-response.ts

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

stdout:

=== Searching for H3Event type definitions or usage ===

=== Check how h3_toResponse is used ===
export function requestHandler<TRegister = unknown>(
  handler: RequestHandler<TRegister>,
) {
  return (request: Request, requestOpts: any): Promise<Response> | Response => {
    const h3Event = new H3Event(request)

    const response = eventStorage.run({ h3Event }, () =>
      handler(request, requestOpts),
    )
    return h3_toResponse(response, h3Event)
  }
}

</shell_result>


Script executed:

#!/bin/bash
# Read broader context around line 186 in server-functions-handler.ts
echo "=== Context around line 186 ==="
sed -n '170,200p' packages/start-server-core/src/server-functions-handler.ts

echo -e "\n=== Context around line 302 ==="
sed -n '285,315p' packages/start-server-core/src/server-functions-handler.ts

echo -e "\n=== Full getResponse usage context ==="
rg -n "setResponseStatus" packages/start-server-core/src/server-functions-handler.ts -B 3 -A 3

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 1

stdout:

=== Context around line 186 ===
      //   const pipeableStream = renderToPipeableStream(result)

      //   setHeaders(event, {
      //     'Content-Type': 'text/x-component',
      //   } as any)

      //   sendStream(event, response)
      //   event._handled = true

      //   return new Response(null, { status: 200 })
      // }

      if (isNotFound(result)) {
        return isNotFoundResponse(result)
      }

      const response = getResponse()
      let nonStreamingBody: any = undefined

      if (result !== undefined) {
        // first run without the stream in case `result` does not need streaming
        let done = false as boolean
        const callbacks: {
          onParse: (value: any) => void
          onDone: () => void
          onError: (error: any) => void
        } = {
          onParse: (value) => {
            nonStreamingBody = value
          },
          onDone: () => {

=== Context around line 302 ===
        return isNotFoundResponse(error)
      }

      console.info()
      console.info('Server Fn Error!')
      console.info()
      console.error(error)
      console.info()

      const serializedError = JSON.stringify(
        await Promise.resolve(
          toCrossJSONAsync(error, {
            refs: new Map(),
            plugins: serovalPlugins,
          }),
        ),
      )
      const response = getResponse()
      return new Response(serializedError, {
        status: response?.status ?? 500,
        statusText: response?.statusText,
        headers: {
          'Content-Type': 'application/json',
          [X_TSS_SERIALIZED]: 'true',
        },
      })
    }
  })()

  request.signal.removeEventListener('abort', abort)


=== Full getResponse usage context ===

</shell_result>


Script executed:

#!/bin/bash
# Check git history of this change if available
echo "=== Git log for request-response.ts around getResponse ==="
git log --oneline -n 20 packages/start-server-core/src/request-response.ts 2>/dev/null | head -10

echo -e "\n=== Git show for recent changes ==="
git log -p -n 1 --all -- packages/start-server-core/src/request-response.ts 2>/dev/null | head -200

echo -e "\n=== Search for TODO or FIXME comments ==="
rg -n "TODO|FIXME|XXX" packages/start-server-core/src/request-response.ts packages/start-server-core/src/server-functions-handler.ts

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

stdout:

=== Git log for request-response.ts around getResponse ===
d239a207f Revert "chore: bump h3-v2 to 2.0.1-rc.5 (#5959)"

=== Git show for recent changes ===

=== Search for TODO or FIXME comments ===
packages/start-server-core/src/server-functions-handler.ts:163:      // TODO: RSCs Where are we getting this package?
packages/start-server-core/src/request-response.ts:78:  // TODO `as any` not needed when fetchdts is updated

</shell_result>


Script executed:

#!/bin/bash
# Get the revert commit details
echo "=== Revert commit details ==="
git show d239a207f --stat

echo -e "\n=== Check the current state vs before ==="
git diff d239a207f~1 d239a207f -- packages/start-server-core/package.json

echo -e "\n=== Look for PR or issue references ==="
git log --all --grep="h3" --oneline | head -10

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

stdout:

=== Revert commit details ===
commit d239a207f5e5124321952a9f0a277643b92ff15c
Author: Birk Skyum <74932975+birkskyum@users.noreply.github.com>
Date:   Wed Nov 26 15:18:11 2025 +0100

    Revert "chore: bump h3-v2 to 2.0.1-rc.5 (#5959)"
    
    This reverts commit 97afc67cb5946cf4177cddaa41be7a7140a1b9a0.

 .gitattributes                                     |     2 +
 .github/FUNDING.yml                                |     1 +
 .github/ISSUE_TEMPLATE/bug_report.yml              |    98 +
 .github/ISSUE_TEMPLATE/config.yml                  |    11 +
 .github/renovate.json                              |    40 +
 .github/workflows/autofix.yml                      |    32 +
 .github/workflows/ci.yml                           |    52 +
 .github/workflows/labeler.yml                      |    16 +
 .github/workflows/pr.yml                           |    54 +
 .gitignore                                         |    81 +
 .npmrc                                             |     3 +
 .nvmrc                                             |     1 +
 .nx/workflows/dynamic-changesets.yaml              |     4 +
 .prettierignore                                    |    18 +
 AGENTS.md                                          |   171 +
 CONTRIBUTING.md                                    |    80 +
 DEBUGGING.md                                       |   334 +
 LICENSE                                            |    21 +
 README.md                                          |   196 +
 docs/router/api/file-based-routing.md              |   203 +
 .../assets/reading-writing-file-devjokes-1.png     |   Bin 0 -> 189723 bytes
 .../assets/reading-writing-file-devjokes-2.png     |   Bin 0 -> 221271 bytes
 docs/router/assets/reading-writing-file-setup.png  |   Bin 0 -> 249861 bytes
 ...h-serialization-deserialization-idempotency.jpg |   Bin 0 -> 28697 bytes
 docs/router/config.json                            |   702 +
 docs/router/eslint/create-route-property-order.md  |    57 +
 docs/router/eslint/eslint-plugin-router.md         |   134 +
 docs/router/framework/react/api/router.md          |    89 +
 .../react/api/router/ActiveLinkOptionsType.md      |    33 +
 .../react/api/router/AsyncRouteComponentType.md    |    12 +
 .../framework/react/api/router/FileRouteClass.md   |    63 +
 .../framework/react/api/router/LinkOptionsType.md  |    51 +
 .../framework/react/api/router/LinkPropsType.md    |    26 +
 .../react/api/router/MatchRouteOptionsType.md      |    44 +
 .../react/api/router/NavigateOptionsType.md        |    78 +
 .../react/api/router/NotFoundErrorType.md          |    50 +
 .../react/api/router/NotFoundRouteClass.md         |    53 +
 .../react/api/router/ParsedHistoryStateType.md     |    14 +
 .../react/api/router/ParsedLocationType.md         |    19 +
 .../framework/react/api/router/RedirectType.md     |    47 +
 .../framework/react/api/router/RegisterType.md     |    28 +
 .../framework/react/api/router/RootRouteClass.md   |    58 +
 .../framework/react/api/router/RouteApiClass.md    |    37 +
 .../framework/react/api/router/RouteApiType.md     |   151 +
 .../framework/react/api/router/RouteClass.md       |    45 +
 .../framework/react/api/router/RouteMaskType.md    |    28 +
 .../framework/react/api/router/RouteMatchType.md   |    29 +
 .../framework/react/api/router/RouteOptionsType.md |   368 +
 .../router/framework/react/api/router/RouteType.md |    31 +
 .../framework/react/api/router/RouterClass.md      |    40 +
 .../framework/react/api/router/RouterEventsType.md |    98 +
 .../react/api/router/RouterOptionsType.md          |   322 +
 .../framework/react/api/router/RouterStateType.md  |    57 +
 .../framework/react/api/router/RouterType.md       |   224 +
 .../react/api/router/ToMaskOptionsType.md          |    14 +
 .../framework/react/api/router/ToOptionsType.md    |    24 +
 .../react/api/router/UseMatchRouteOptionsType.md   |    13 +
 .../react/api/router/ViewTransitionOptionsType.md  |    41 +
 .../framework/react/api/router/awaitComponent.md   |    46 +
 .../react/api/router/catchBoundaryComponent.md     |    56 +
 .../react/api/router/catchNotFoundComponent.md     |    49 +
 .../react/api/router/clientOnlyComponent.md        |    50 +
 .../react/api/router/createFileRouteFunction.md    |    40 +
 .../api/router/createLazyFileRouteFunction.md      |    48 +
 .../react/api/router/createLazyRouteFunction.md    |    71 +
 .../react/api/router/createRootRouteFunction.md    |    50 +
 .../router/createRootRouteWithContextFunction.md   |    53 +
 .../react/api/router/createRouteFunction.md        |    37 +
 .../react/api/router/createRouteMaskFunction.md    |    35 +
 .../react/api/router/createRouterFunction.md       |    32 +
 .../api/router/defaultGlobalNotFoundComponent.md   |    12 +
 .../framework/react/api/router/deferFunction.md    |    49 +
 .../react/api/router/errorComponentComponent.md    |    32 +
 .../react/api/router/getRouteApiFunction.md        |    33 +
 .../react/api/router/historyStateInterface.md      |    20 +
 .../react/api/router/isNotFoundFunction.md         |    34 +
 .../react/api/router/isRedirectFunction.md         |    34 +
 .../react/api/router/lazyRouteComponentFunction.md |    50 +
 .../framework/react/api/router/linkComponent.md    |    37 +
 .../framework/react/api/router/linkOptions.md      |    38 +
 .../react/api/router/matchRouteComponent.md        |    42 +
 .../react/api/router/navigateComponent.md          |    18 +
 .../react/api/router/notFoundComponentComponent.md |    36 +
 .../framework/react/api/router/notFoundFunction.md |    40 +
 .../framework/react/api/router/outletComponent.md  |    15 +
 .../framework/react/api/router/redirectFunction.md |    53 +
 .../react/api/router/retainSearchParamsFunction.md |    48 +
 .../api/router/rootRouteWithContextFunction.md     |    54 +
 .../react/api/router/stripSearchParamsFunction.md  |    78 +
 .../framework/react/api/router/useAwaitedHook.md   |    35 +
 .../framework/react/api/router/useBlockerHook.md   |   213 +
 .../framework/react/api/router/useCanGoBack.md     |    40 +
 .../react/api/router/useChildMatchesHook.md        |    42 +
 .../framework/react/api/router/useLinkPropsHook.md |    21 +
 .../react/api/router/useLoaderDataHook.md          |    54 +
 .../react/api/router/useLoaderDepsHook.md          |    58 +
 .../framework/react/api/router/useLocationHook.md  |    40 +
 .../framework/react/api/router/useMatchHook.md     |    93 +
 .../react/api/router/useMatchRouteHook.md          |   116 +
 .../framework/react/api/router/useMatchesHook.md   |    43 +
 .../framework/react/api/router/useNavigateHook.md  |    93 +
 .../framework/react/api/router/useParamsHook.md    |    69 +
 .../react/api/router/useParentMatchesHook.md       |    42 +
 .../react/api/router/useRouteContextHook.md        |    47 +
 .../framework/react/api/router/useRouterHook.md    |    25 +
 .../react/api/router/useRouterStateHook.md         |    50 +
 .../framework/react/api/router/useSearchHook.md    |    73 +
 docs/router/framework/react/comparison.md          |    96 +
 docs/router/framework/react/decisions-on-dx.md     |   237 +
 docs/router/framework/react/devtools.md            |   191 +
 docs/router/framework/react/faq.md                 |    66 +
 .../framework/react/guide/authenticated-routes.md  |   184 +
 .../react/guide/automatic-code-splitting.md        |   232 +
 .../router/framework/react/guide/code-splitting.md |   305 +
 .../framework/react/guide/creating-a-router.md     |    76 +
 docs/router/framework/react/guide/custom-link.md   |   238 +
 .../guide/custom-search-param-serialization.md     |   228 +
 docs/router/framework/react/guide/data-loading.md  |   547 +
 .../router/framework/react/guide/data-mutations.md |   140 +
 .../framework/react/guide/deferred-data-loading.md |   162 +
 .../react/guide/document-head-management.md        |   158 +
 .../framework/react/guide/external-data-loading.md |   188 +
 docs/router/framework/react/guide/history-types.md |    55 +
 docs/router/framework/react/guide/link-options.md  |   117 +
 .../framework/react/guide/navigation-blocking.md   |   260 +
 docs/router/framework/react/guide/navigation.md    |   796 +
 .../framework/react/guide/not-found-errors.md      |   303 +
 docs/router/framework/react/guide/outlets.md       |    31 +
 .../framework/react/guide/parallel-routes.md       |     5 +
 docs/router/framework/react/guide/path-params.md   |   763 +
 docs/router/framework/react/guide/preloading.md    |   153 +
 .../framework/react/guide/render-optimizations.md  |    88 +
 docs/router/framework/react/guide/route-masking.md |   140 +
 .../router/framework/react/guide/router-context.md |   350 +
 .../framework/react/guide/scroll-restoration.md    |   203 +
 docs/router/framework/react/guide/search-params.md |   676 +
 docs/router/framework/react/guide/ssr.md           |   213 +
 .../framework/react/guide/static-route-data.md     |    81 +
 docs/router/framework/react/guide/type-safety.md   |   287 +
 .../router/framework/react/guide/type-utilities.md |   201 +
 docs/router/framework/react/how-to/README.md       |    82 +
 .../how-to/arrays-objects-dates-search-params.md   |   768 +
 .../framework/react/how-to/debug-router-issues.md  |   768 +
 .../framework/react/how-to/deploy-to-production.md |   448 +
 .../router/framework/react/how-to/drafts/README.md |    64 +
 .../drafts/build-search-filtering-systems.draft.md |   192 +
 .../optimize-search-param-performance.draft.md     |    90 +
 .../how-to/drafts/search-params-in-forms.draft.md  |   157 +
 docs/router/framework/react/how-to/install.md      |    47 +
 .../framework/react/how-to/integrate-chakra-ui.md  |   823 +
 .../react/how-to/integrate-framer-motion.md        |   778 +
 .../react/how-to/integrate-material-ui.md          |   717 +
 .../framework/react/how-to/integrate-shadcn-ui.md  |   518 +
 .../react/how-to/migrate-from-react-router.md      |   744 +
 .../react/how-to/navigate-with-search-params.md    |   345 +
 .../framework/react/how-to/setup-auth-providers.md |   634 +
 .../framework/react/how-to/setup-authentication.md |   485 +
 .../react/how-to/setup-basic-search-params.md      |   431 +
 docs/router/framework/react/how-to/setup-rbac.md   |   738 +
 docs/router/framework/react/how-to/setup-ssr.md    |   554 +
 .../router/framework/react/how-to/setup-testing.md |   975 +
 .../how-to/share-search-params-across-routes.md    |   245 +
 .../react/how-to/test-file-based-routing.md        |   952 +
 .../react/how-to/use-environment-variables.md      |   689 +
 .../react/how-to/validate-search-params.md         |   643 +
 docs/router/framework/react/installation/manual.md |   231 +
 .../installation/migrate-from-react-location.md    |   267 +
 .../installation/migrate-from-react-router.md      |    34 +
 .../framework/react/installation/with-esbuild.md   |    82 +
 .../react/installation/with-router-cli.md          |   103 +
 .../framework/react/installation/with-rspack.md    |    88 +
 .../framework/react/installation/with-vite.md      |    90 +
 .../framework/react/installation/with-webpack.md   |    81 +
 docs/router/framework/react/llm-support.md         |    32 +
 docs/router/framework/react/overview.md            |   141 +
 docs/router/framework/react/quick-start.md         |   140 +
 .../framework/react/routing/code-based-routing.md  |   433 +
 .../framework/react/routing/file-based-routing.md  |   125 +
 .../react/routing/file-naming-conventions.md       |    46 +
 .../framework/react/routing/route-matching.md      |    93 +
 docs/router/framework/react/routing/route-trees.md |    67 +
 .../framework/react/routing/routing-concepts.md    |   462 +
 .../framework/react/routing/virtual-file-routes.md |   360 +
 docs/router/framework/solid/decisions-on-dx.md     |     4 +
 docs/router/framework/solid/devtools.md            |    11 +
 docs/router/framework/solid/faq.md                 |     4 +
 .../framework/solid/guide/authenticated-routes.md  |     9 +
 .../solid/guide/automatic-code-splitting.md        |     4 +
 .../router/framework/solid/guide/code-splitting.md |     4 +
 .../framework/solid/guide/creating-a-router.md     |     4 +
 docs/router/framework/solid/guide/custom-link.md   |    46 +
 .../guide/custom-search-param-serialization.md     |     4 +
 docs/router/framework/solid/guide/data-loading.md  |     4 +
 .../router/framework/solid/guide/data-mutations.md |     4 +
 .../framework/solid/guide/deferred-data-loading.md |     9 +
 .../solid/guide/document-head-management.md        |     4 +
 .../framework/solid/guide/external-data-loading.md |     4 +
 docs/router/framework/solid/guide/history-types.md |     4 +
 docs/router/framework/solid/guide/link-options.md  |     4 +
 .../framework/solid/guide/navigation-blocking.md   |   157 +
 docs/router/framework/solid/guide/navigation.md    |     4 +
 .../framework/solid/guide/not-found-errors.md      |     4 +
 docs/router/framework/solid/guide/outlets.md       |     4 +
 docs/router/framework/solid/guide/path-params.md   |    15 +
 docs/router/framework/solid/guide/preloading.md    |     4 +
 docs/router/framework/solid/guide/route-masking.md |     4 +
 .../router/framework/solid/guide/router-context.md |     4 +
 .../framework/solid/guide/scroll-restoration.md    |    45 +
 docs/router/framework/solid/guide/search-params.md |     4 +
 docs/router/framework/solid/guide/ssr.md           |    19 +
 .../framework/solid/guide/static-route-data.md     |     4 +
 docs/router/framework/solid/guide/type-safety.md   |     4 +
 .../router/framework/solid/guide/type-utilities.md |    39 +
 docs/router/framework/solid/installation/manual.md |    11 +
 .../framework/solid/installation/with-esbuild.md   |    99 +
 .../solid/installation/with-router-cli.md          |    31 +
 .../framework/solid/installation/with-rspack.md    |    89 +
 .../framework/solid/installation/with-vite.md      |    49 +
 .../framework/solid/installation/with-webpack.md   |    92 +
 docs/router/framework/solid/llm-support.md         |     3 +
 docs/router/framework/solid/overview.md            |     4 +
 docs/router/framework/solid/quick-start.md         |    65 +
 .../framework/solid/routing/code-based-routing.md  |     4 +
 .../framework/solid/routing/file-based-routing.md  |    54 +
 .../solid/routing/file-naming-conventions.md       |     4 +
 .../framework/solid/routing/route-matching.md      |     4 +
 docs/router/framework/solid/routing/route-trees.md |     4 +
 .../framework/solid/routing/routing-concepts.md    |     4 +
 .../framework/solid/routing/virtual-file-routes.md |     5 +
 docs/router/integrations/query.md                  |   144 +
 docs/start/config.json                             |   385 +
 docs/start/framework/react/build-from-scratch.md   |   282 +
 docs/start/framework/react/getting-started.md      |    24 +
 .../react/guide/authentication-overview.md         |   239 +
 docs/start/framework/react/guide/authentication.md |   610 +
 .../framework/react/guide/client-entry-point.md    |    73 +
 .../react/guide/code-execution-patterns.md         |   146 +
 docs/start/framework/react/guide/databases.md      |   106 +
 .../framework/react/guide/environment-functions.md |   123 +
 .../framework/react/guide/environment-variables.md |   473 +
 .../framework/react/guide/error-boundaries.md      |    53 +
 .../start/framework/react/guide/execution-model.md |   332 +
 docs/start/framework/react/guide/hosting.md        |   400 +
 .../framework/react/guide/hydration-errors.md      |   136 +
 docs/start/framework/react/guide/middleware.md     |   550 +
 docs/start/framework/react/guide/observability.md  |   778 +
 docs/start/framework/react/guide/path-aliases.md   |    57 +
 docs/start/framework/react/guide/routing.md        |   235 +
 docs/start/framework/react/guide/selective-ssr.md  |   228 +
 .../framework/react/guide/server-entry-point.md    |   102 +
 .../framework/react/guide/server-functions.md      |   275 +
 docs/start/framework/react/guide/server-routes.md  |   443 +
 docs/start/framework/react/guide/spa-mode.md       |   188 +
 .../framework/react/guide/static-prerendering.md   |    88 +
 .../react/guide/static-server-functions.md         |    35 +
 .../guide/streaming-data-from-server-functions.md  |    97 +
 .../framework/react/guide/tailwind-integration.md  |   139 +
 docs/start/framework/react/migrate-from-next-js.md |   432 +
 docs/start/framework/react/overview.md             |    49 +
 docs/start/framework/react/quick-start.md          |    86 +
 .../react/tutorial/fetching-external-api.md        |   317 +
 .../react/tutorial/reading-writing-file.md         |   583 +
 docs/start/framework/solid/build-from-scratch.md   |   268 +
 docs/start/framework/solid/getting-started.md      |    17 +
 .../solid/guide/authentication-overview.md         |     9 +
 docs/start/framework/solid/guide/authentication.md |   602 +
 .../framework/solid/guide/client-entry-point.md    |    64 +
 .../solid/guide/code-execution-patterns.md         |   146 +
 docs/start/framework/solid/guide/databases.md      |     5 +
 .../framework/solid/guide/environment-functions.md |     4 +
 .../framework/solid/guide/environment-variables.md |   473 +
 .../framework/solid/guide/error-boundaries.md      |    52 +
 .../start/framework/solid/guide/execution-model.md |   331 +
 docs/start/framework/solid/guide/hosting.md        |   389 +
 .../framework/solid/guide/hydration-errors.md      |   129 +
 docs/start/framework/solid/guide/middleware.md     |     5 +
 docs/start/framework/solid/guide/observability.md  |   661 +
 docs/start/framework/solid/guide/path-aliases.md   |     5 +
 .../framework/solid/guide/reading-writing-file.md  |     5 +
 docs/start/framework/solid/guide/routing.md        |   231 +
 docs/start/framework/solid/guide/selective-ssr.md  |   222 +
 .../framework/solid/guide/server-entry-point.md    |     5 +
 .../framework/solid/guide/server-functions.md      |     9 +
 docs/start/framework/solid/guide/server-routes.md  |   443 +
 docs/start/framework/solid/guide/spa-mode.md       |     5 +
 .../framework/solid/guide/static-prerendering.md   |    88 +
 .../solid/guide/static-server-functions.md         |     5 +
 .../framework/solid/guide/tailwind-integration.md  |   144 +
 docs/start/framework/solid/overview.md             |     9 +
 docs/start/framework/solid/quick-start.md          |    63 +
 e2e/e2e-utils/eslint.config.js                     |     5 +
 e2e/e2e-utils/package.json                         |    40 +
 e2e/e2e-utils/src/derivePort.ts                    |    27 +
 e2e/e2e-utils/src/e2eSetupTeardown.ts              |    16 +
 e2e/e2e-utils/src/fixture.ts                       |    28 +
 e2e/e2e-utils/src/index.ts                         |     7 +
 e2e/e2e-utils/src/localDummyServer.ts              |   128 +
 e2e/e2e-utils/src/posts.ts                         |   619 +
 e2e/e2e-utils/src/resolve-runtime-suffix.ts        |    13 +
 e2e/e2e-utils/src/to-runtime-path.ts               |    17 +
 e2e/e2e-utils/src/users.ts                         |   258 +
 e2e/e2e-utils/tsconfig.json                        |     4 +
 e2e/e2e-utils/vite.config.ts                       |    39 +
 e2e/react-router/basepath-file-based/.gitignore    |    11 +
 e2e/react-router/basepath-file-based/index.html    |    11 +
 e2e/react-router/basepath-file-based/package.json  |    28 +
 .../basepath-file-based/playwright.config.ts       |    41 +
 e2e/react-router/basepath-file-based/src/main.tsx  |    27 +
 .../basepath-file-based/src/routeTree.gen.ts       |    77 +
 .../basepath-file-based/src/routes/__root.tsx      |     3 +
 .../basepath-file-based/src/routes/about.tsx       |    20 +
 .../basepath-file-based/src/routes/index.tsx       |    25 +
 .../tests/reload-document.test.ts                  |    18 +
 .../tests/setup/global.setup.ts                    |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 e2e/react-router/basepath-file-based/tsconfig.json |    15 +
 .../basepath-file-based/vite.config.js             |     9 +
 .../basic-esbuild-file-based/.gitignore            |    11 +
 .../basic-esbuild-file-based/index.html            |    24 +
 .../basic-esbuild-file-based/package.json          |    29 +
 .../basic-esbuild-file-based/playwright.config.ts  |    41 +
 .../basic-esbuild-file-based/src/esbuild.config.js |    10 +
 .../basic-esbuild-file-based/src/main.tsx          |    26 +
 .../basic-esbuild-file-based/src/posts.tsx         |    36 +
 .../basic-esbuild-file-based/src/routeTree.gen.ts  |   424 +
 .../src/routes/(group)/_layout.inside.tsx          |    23 +
 .../src/routes/(group)/_layout.tsx                 |    10 +
 .../src/routes/(group)/lazyinside.lazy.tsx         |    24 +
 .../src/routes/(group)/lazyinside.tsx              |     7 +
 .../basic-esbuild-file-based/src/routes/__root.tsx |    82 +
 .../src/routes/_layout.tsx                         |    16 +
 .../src/routes/_layout/_layout-2.tsx               |    34 +
 .../src/routes/_layout/_layout-2/layout-a.tsx      |     9 +
 .../src/routes/_layout/_layout-2/layout-b.tsx      |     9 +
 .../basic-esbuild-file-based/src/routes/index.tsx  |    14 +
 .../src/routes/posts.$postId.tsx                   |    28 +
 .../src/routes/posts.index.tsx                     |    10 +
 .../basic-esbuild-file-based/src/routes/posts.tsx  |    39 +
 .../basic-esbuild-file-based/tests/app.spec.ts     |    48 +
 .../tests/setup/global.setup.ts                    |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 .../basic-esbuild-file-based/tsconfig.json         |    14 +
 .../basic-file-based-code-splitting/.gitignore     |    11 +
 .../basic-file-based-code-splitting/index.html     |    12 +
 .../basic-file-based-code-splitting/package.json   |    34 +
 .../playwright.config.ts                           |    41 +
 .../postcss.config.mjs                             |     5 +
 .../basic-file-based-code-splitting/src/main.tsx   |    27 +
 .../basic-file-based-code-splitting/src/posts.tsx  |    36 +
 .../src/routeTree.gen.ts                           |   360 +
 .../src/routes/__root.tsx                          |    80 +
 .../src/routes/_layout.tsx                         |    16 +
 .../src/routes/_layout/_layout-2.tsx               |    34 +
 .../src/routes/_layout/_layout-2/layout-a.tsx      |     7 +
 .../src/routes/_layout/_layout-2/layout-b.tsx      |     7 +
 .../src/routes/index.tsx                           |    13 +
 .../src/routes/posts.$postId.tsx                   |    32 +
 .../src/routes/posts.index.tsx                     |     9 +
 .../src/routes/posts.tsx                           |    39 +
 .../src/routes/viewport-test.tsx                   |     3 +
 .../src/routes/without-loader.tsx                  |     3 +
 .../basic-file-based-code-splitting/src/styles.css |    21 +
 .../tests/app.spec.ts                              |    33 +
 .../tests/preload.spec.ts                          |    42 +
 .../tests/setup/global.setup.ts                    |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 .../basic-file-based-code-splitting/tsconfig.json  |    15 +
 .../basic-file-based-code-splitting/vite.config.ts |    41 +
 e2e/react-router/basic-file-based/.gitignore       |    11 +
 e2e/react-router/basic-file-based/index.html       |    11 +
 e2e/react-router/basic-file-based/package.json     |    41 +
 .../basic-file-based/playwright.config.ts          |    58 +
 .../basic-file-based/postcss.config.mjs            |     5 +
 .../src/components/RenderCounter.tsx               |     7 +
 e2e/react-router/basic-file-based/src/main.tsx     |    27 +
 e2e/react-router/basic-file-based/src/posts.tsx    |    36 +
 .../basic-file-based/src/routeTree.gen.ts          |  2466 ++
 .../src/routes/(another-group)/onlyrouteinside.tsx |    26 +
 .../src/routes/(group)/_layout.insidelayout.tsx    |    24 +
 .../src/routes/(group)/_layout.tsx                 |    11 +
 .../basic-file-based/src/routes/(group)/inside.tsx |    24 +
 .../src/routes/(group)/lazyinside.lazy.tsx         |    21 +
 .../src/routes/(group)/lazyinside.tsx              |     7 +
 .../src/routes/(group)/subfolder/inside.tsx        |    24 +
 .../basic-file-based/src/routes/__root.tsx         |   157 +
 .../basic-file-based/src/routes/_layout.tsx        |    17 +
 .../src/routes/_layout/_layout-2.tsx               |    35 +
 .../src/routes/_layout/_layout-2/layout-a.tsx      |     8 +
 .../src/routes/_layout/_layout-2/layout-b.tsx      |     8 +
 .../basic-file-based/src/routes/anchor.tsx         |   220 +
 .../src/routes/component-types-test.tsx            |    12 +
 .../basic-file-based/src/routes/editing-a.tsx      |    46 +
 .../basic-file-based/src/routes/editing-b.tsx      |    40 +
 .../src/routes/hover-preload-hash.tsx              |   265 +
 .../basic-file-based/src/routes/index.tsx          |    14 +
 .../src/routes/non-nested/deep/$baz.index.tsx      |    19 +
 .../src/routes/non-nested/deep/$baz.route.tsx      |    16 +
 .../non-nested/deep/$baz_.bar.$foo.index.tsx       |    19 +
 .../non-nested/deep/$baz_.bar.$foo.route.tsx       |    16 +
 .../routes/non-nested/deep/$baz_.bar.$foo_.qux.tsx |    19 +
 .../src/routes/non-nested/deep/$baz_.bar.index.tsx |    19 +
 .../src/routes/non-nested/deep/$baz_.bar.route.tsx |    16 +
 .../src/routes/non-nested/deep/$baz_.bar_.qux.tsx  |    19 +
 .../src/routes/non-nested/deep/route.tsx           |    58 +
 .../src/routes/non-nested/named/$baz.foo.tsx       |    20 +
 .../src/routes/non-nested/named/$baz.index.tsx     |    19 +
 .../src/routes/non-nested/named/$baz.route.tsx     |    16 +
 .../src/routes/non-nested/named/$baz_.bar.tsx      |    19 +
 .../src/routes/non-nested/named/route.tsx          |    58 +
 .../src/routes/non-nested/path/baz.foo.tsx         |    20 +
 .../src/routes/non-nested/path/baz.index.tsx       |    19 +
 .../src/routes/non-nested/path/baz.route.tsx       |    16 +
 .../src/routes/non-nested/path/baz_.bar.tsx        |    19 +
 .../src/routes/non-nested/path/route.tsx           |    33 +
 .../routes/non-nested/prefix/prefix{$baz}.foo.tsx  |    20 +
 .../non-nested/prefix/prefix{$baz}.index.tsx       |    19 +
 .../non-nested/prefix/prefix{$baz}.route.tsx       |    16 +
 .../routes/non-nested/prefix/prefix{$baz}_.bar.tsx |    19 +
 .../src/routes/non-nested/prefix/route.tsx         |    58 +
 .../src/routes/non-nested/route.tsx                |    32 +
 .../src/routes/non-nested/suffix/route.tsx         |    58 +
 .../routes/non-nested/suffix/{$baz}suffix.foo.tsx  |    20 +
 .../non-nested/suffix/{$baz}suffix.index.tsx       |    19 +
 .../non-nested/suffix/{$baz}suffix.route.tsx       |    16 +
 .../routes/non-nested/suffix/{$baz}suffix_.bar.tsx |    19 +
 .../basic-file-based/src/routes/notRemountDeps.tsx |    44 +
 .../src/routes/params-ps/index.tsx                 |   127 +
 .../src/routes/params-ps/named/$foo/$bar.$baz.tsx  |    17 +
 .../src/routes/params-ps/named/$foo/$bar.route.tsx |    45 +
 .../src/routes/params-ps/named/$foo/route.tsx      |    50 +
 .../src/routes/params-ps/named/index.tsx           |     7 +
 .../src/routes/params-ps/named/prefix{$foo}.tsx    |    14 +
 .../src/routes/params-ps/named/{$foo}suffix.tsx    |    14 +
 .../src/routes/params-ps/non-nested/$foo_/$bar.tsx |    23 +
 .../routes/params-ps/non-nested/$foo_/route.tsx    |     3 +
 .../src/routes/params-ps/non-nested/route.tsx      |    34 +
 .../src/routes/params-ps/wildcard/$.tsx            |    14 +
 .../src/routes/params-ps/wildcard/index.tsx        |     8 +
 .../params-ps/wildcard/prefix@\353\214\200{$}.tsx" |    15 +
 .../src/routes/params-ps/wildcard/prefix{$}.tsx    |    14 +
 .../src/routes/params-ps/wildcard/{$}suffix.tsx    |    14 +
 .../params-ps/wildcard/{$}suffix@\353\214\200.tsx" |    15 +
 .../src/routes/params.single.$value.tsx            |    43 +
 .../basic-file-based/src/routes/posts.$postId.tsx  |    31 +
 .../basic-file-based/src/routes/posts.index.tsx    |    10 +
 .../basic-file-based/src/routes/posts.tsx          |    47 +
 .../src/routes/posts_.$postId.edit.tsx             |    29 +
 .../src/routes/redirect/$target.tsx                |    22 +
 .../src/routes/redirect/$target/index.tsx          |    66 +
 .../src/routes/redirect/$target/via-beforeLoad.tsx |    17 +
 .../src/routes/redirect/$target/via-loader.tsx     |    19 +
 .../basic-file-based/src/routes/redirect/index.tsx |    29 +
 .../src/routes/redirect/preload/first.tsx          |    24 +
 .../src/routes/redirect/preload/second.tsx         |    15 +
 .../src/routes/redirect/preload/third.tsx          |     8 +
 .../basic-file-based/src/routes/relative/index.tsx |    22 +
 .../src/routes/relative/link/nested/deep/index.tsx |    13 +
 .../src/routes/relative/link/nested/index.tsx      |    13 +
 .../src/routes/relative/link/path/$path/index.tsx  |    31 +
 .../src/routes/relative/link/path/index.tsx        |    18 +
 .../src/routes/relative/link/relative-link-a.tsx   |    13 +
 .../src/routes/relative/link/relative-link-b.tsx   |    13 +
 .../src/routes/relative/link/route.tsx             |   103 +
 .../src/routes/relative/link/with-search/index.tsx |    28 +
 .../relative/useNavigate/nested/deep/index.tsx     |    13 +
 .../routes/relative/useNavigate/nested/index.tsx   |    13 +
 .../relative/useNavigate/path/$path/index.tsx      |    40 +
 .../src/routes/relative/useNavigate/path/index.tsx |    18 +
 .../useNavigate/relative-useNavigate-a.tsx         |    15 +
 .../useNavigate/relative-useNavigate-b.tsx         |    15 +
 .../src/routes/relative/useNavigate/route.tsx      |   134 +
 .../relative/useNavigate/with-search/index.tsx     |    34 +
 .../basic-file-based/src/routes/remountDeps.tsx    |    44 +
 .../src/routes/search-params/default.tsx           |    28 +
 .../src/routes/search-params/index.tsx             |    43 +
 .../src/routes/search-params/route.tsx             |     8 +
 .../src/routes/structural-sharing.$enabled.tsx     |    80 +
 .../route.tsx"                                     |    63 +
 .../wildcard.$.tsx"                                |    19 +
 .../\360\237\232\200.$id.tsx"                      |    19 +
 e2e/react-router/basic-file-based/src/styles.css   |    21 +
 .../basic-file-based/tests/app.spec.ts             |   328 +
 .../tests/hover-preload-hash.spec.ts               |    24 +
 .../tests/non-nested-paths.spec.ts                 |   350 +
 .../basic-file-based/tests/params.spec.ts          |   494 +
 .../basic-file-based/tests/redirect.spec.ts        |   136 +
 .../basic-file-based/tests/relative.spec.ts        |   273 +
 .../tests/scroll-into-view.spec.ts                 |   213 +
 .../basic-file-based/tests/search-params.spec.ts   |   143 +
 .../basic-file-based/tests/setup/global.setup.ts   |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 .../tests/utils/useExperimentalNonNestedRoutes.ts  |     6 +
 e2e/react-router/basic-file-based/tsconfig.json    |    15 +
 e2e/react-router/basic-file-based/vite.config.js   |    16 +
 .../basic-react-query-file-based/.gitignore        |    11 +
 .../basic-react-query-file-based/index.html        |    12 +
 .../basic-react-query-file-based/package.json      |    35 +
 .../playwright.config.ts                           |    40 +
 .../postcss.config.mjs                             |     5 +
 .../basic-react-query-file-based/src/main.tsx      |    39 +
 .../src/postQueryOptions.tsx                       |     8 +
 .../basic-react-query-file-based/src/posts.tsx     |    37 +
 .../src/postsQueryOptions.tsx                      |     7 +
 .../src/routeTree.gen.ts                           |   246 +
 .../src/routes/__root.tsx                          |    70 +
 .../src/routes/_layout.tsx                         |    17 +
 .../src/routes/_layout/_layout-2.tsx               |    35 +
 .../src/routes/_layout/_layout-2/layout-a.tsx      |     8 +
 .../src/routes/_layout/_layout-2/layout-b.tsx      |     8 +
 .../src/routes/index.tsx                           |    14 +
 .../src/routes/posts.$postId.tsx                   |    55 +
 .../src/routes/posts.index.tsx                     |    10 +
 .../src/routes/posts.tsx                           |    43 +
 .../basic-react-query-file-based/src/styles.css    |    21 +
 .../basic-react-query-file-based/tests/app.spec.ts |    51 +
 .../tests/setup/global.setup.ts                    |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 .../basic-react-query-file-based/tsconfig.json     |    15 +
 .../basic-react-query-file-based/vite.config.js    |    11 +
 e2e/react-router/basic-react-query/.gitignore      |    11 +
 e2e/react-router/basic-react-query/index.html      |    12 +
 e2e/react-router/basic-react-query/package.json    |    33 +
 .../basic-react-query/playwright.config.ts         |    41 +
 .../basic-react-query/postcss.config.mjs           |     5 +
 e2e/react-router/basic-react-query/src/main.tsx    |   276 +
 .../basic-react-query/src/posts.lazy.tsx           |    40 +
 e2e/react-router/basic-react-query/src/posts.ts    |    48 +
 e2e/react-router/basic-react-query/src/styles.css  |    21 +
 .../basic-react-query/tests/app.spec.ts            |    33 +
 .../basic-react-query/tests/setup/global.setup.ts  |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 e2e/react-router/basic-react-query/tsconfig.json   |    15 +
 e2e/react-router/basic-react-query/vite.config.js  |     7 +
 .../basic-scroll-restoration/.gitignore            |    11 +
 .../basic-scroll-restoration/index.html            |    12 +
 .../basic-scroll-restoration/package.json          |    32 +
 .../basic-scroll-restoration/playwright.config.ts  |    34 +
 .../basic-scroll-restoration/postcss.config.mjs    |     5 +
 .../basic-scroll-restoration/src/main.tsx          |   297 +
 .../basic-scroll-restoration/src/styles.css        |    21 +
 .../basic-scroll-restoration/tests/app.spec.ts     |   117 +
 .../tests/router-events.spec.ts                    |    44 +
 .../basic-scroll-restoration/tsconfig.json         |    14 +
 .../basic-scroll-restoration/vite.config.js        |     7 +
 .../basic-virtual-file-based/.gitignore            |    11 +
 .../basic-virtual-file-based/index.html            |    12 +
 .../basic-virtual-file-based/package.json          |    34 +
 .../basic-virtual-file-based/playwright.config.ts  |    41 +
 .../basic-virtual-file-based/postcss.config.mjs    |     5 +
 .../basic-virtual-file-based/routes.ts             |    22 +
 .../basic-virtual-file-based/src/main.tsx          |    27 +
 .../basic-virtual-file-based/src/posts.tsx         |    38 +
 .../basic-virtual-file-based/src/routeTree.gen.ts  |   428 +
 .../basic-virtual-file-based/src/routes/a.tsx      |     7 +
 .../basic-virtual-file-based/src/routes/b.tsx      |     7 +
 .../src/routes/file-based-subtree/hello/index.tsx  |     3 +
 .../src/routes/file-based-subtree/hello/route.tsx  |    27 +
 .../routes/file-based-subtree/hello/universe.tsx   |     3 +
 .../src/routes/file-based-subtree/hello/world.tsx  |     3 +
 .../basic-virtual-file-based/src/routes/home.tsx   |    13 +
 .../src/routes/layout/first-layout.tsx             |    16 +
 .../src/routes/layout/second-layout.tsx            |    34 +
 .../src/routes/posts/posts-detail.tsx              |    28 +
 .../src/routes/posts/posts-home.tsx                |     9 +
 .../src/routes/posts/posts.tsx                     |    39 +
 .../basic-virtual-file-based/src/routes/root.tsx   |    70 +
 .../basic-virtual-file-based/src/styles.css        |    21 +
 .../basic-virtual-file-based/tests/app.spec.ts     |    33 +
 .../tests/setup/global.setup.ts                    |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 .../basic-virtual-file-based/tsconfig.json         |    15 +
 .../basic-virtual-file-based/vite.config.ts        |    17 +
 .../.gitignore                                     |    13 +
 .../index.html                                     |    12 +
 .../package.json                                   |    34 +
 .../playwright.config.ts                           |    41 +
 .../postcss.config.mjs                             |     5 +
 .../routes.ts                                      |    22 +
 .../src/main.tsx                                   |    27 +
 .../src/posts.tsx                                  |    36 +
 .../src/routes/a.tsx                               |     7 +
 .../src/routes/b.tsx                               |     7 +
 .../src/routes/file-based-subtree/hello/index.tsx  |     3 +
 .../src/routes/file-based-subtree/hello/route.tsx  |    27 +
 .../routes/file-based-subtree/hello/universe.tsx   |     3 +
 .../src/routes/file-based-subtree/hello/world.tsx  |     3 +
 .../src/routes/home.tsx                            |    13 +
 .../src/routes/layout/first-layout.tsx             |    16 +
 .../src/routes/layout/second-layout.tsx            |    34 +
 .../src/routes/posts/posts-detail.tsx              |    28 +
 .../src/routes/posts/posts-home.tsx                |     9 +
 .../src/routes/posts/posts.tsx                     |    39 +
 .../src/routes/root.tsx                            |    70 +
 .../src/styles.css                                 |    23 +
 .../tests/app.spec.ts                              |    36 +
 .../tests/setup/global.setup.ts                    |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 .../tsconfig.json                                  |    15 +
 .../vite.config.ts                                 |    16 +
 e2e/react-router/basic/.gitignore                  |    11 +
 e2e/react-router/basic/index.html                  |    12 +
 e2e/react-router/basic/package.json                |    31 +
 e2e/react-router/basic/playwright.config.ts        |    41 +
 e2e/react-router/basic/postcss.config.mjs          |     5 +
 e2e/react-router/basic/src/main.tsx                |   456 +
 e2e/react-router/basic/src/posts.lazy.tsx          |    36 +
 e2e/react-router/basic/src/posts.ts                |    36 +
 e2e/react-router/basic/src/styles.css              |    21 +
 e2e/react-router/basic/tests/app.spec.ts           |    64 +
 e2e/react-router/basic/tests/params.spec.ts        |   149 +
 e2e/react-router/basic/tests/setup/global.setup.ts |     6 +
 .../basic/tests/setup/global.teardown.ts           |     6 +
 e2e/react-router/basic/tsconfig.json               |    15 +
 e2e/react-router/basic/vite.config.js              |     7 +
 e2e/react-router/generator-cli-only/.gitignore     |    11 +
 e2e/react-router/generator-cli-only/index.html     |    12 +
 e2e/react-router/generator-cli-only/package.json   |    32 +
 .../generator-cli-only/playwright.config.ts        |    41 +
 .../generator-cli-only/postcss.config.mjs          |     5 +
 e2e/react-router/generator-cli-only/src/main.tsx   |    31 +
 e2e/react-router/generator-cli-only/src/posts.ts   |    36 +
 .../generator-cli-only/src/routeTree.gen.ts        |   230 +
 .../generator-cli-only/src/routes/__root.tsx       |    62 +
 .../src/routes/_pathlessLayout.tsx                 |    17 +
 .../src/routes/_pathlessLayout/_nested-layout.tsx  |    35 +
 .../_pathlessLayout/_nested-layout/route-a.tsx     |    10 +
 .../_pathlessLayout/_nested-layout/route-b.tsx     |    10 +
 .../generator-cli-only/src/routes/index.tsx        |    14 +
 .../src/routes/posts.$postId.tsx                   |    29 +
 .../generator-cli-only/src/routes/posts.index.tsx  |    10 +
 .../generator-cli-only/src/routes/posts.route.tsx  |    40 +
 e2e/react-router/generator-cli-only/src/styles.css |    21 +
 .../generator-cli-only/tests/app.spec.ts           |    35 +
 .../generator-cli-only/tests/setup/global.setup.ts |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 e2e/react-router/generator-cli-only/tsconfig.json  |    15 +
 .../generator-cli-only/tsr.config.json             |     4 +
 e2e/react-router/generator-cli-only/vite.config.js |     7 +
 e2e/react-router/js-only-file-based/.gitignore     |    11 +
 e2e/react-router/js-only-file-based/index.html     |    12 +
 e2e/react-router/js-only-file-based/package.json   |    32 +
 .../js-only-file-based/playwright.config.ts        |    42 +
 .../js-only-file-based/postcss.config.mjs          |     5 +
 e2e/react-router/js-only-file-based/src/main.jsx   |    24 +
 e2e/react-router/js-only-file-based/src/posts.js   |    27 +
 .../js-only-file-based/src/routeTree.gen.js        |    95 +
 .../js-only-file-based/src/routes/__root.jsx       |    62 +
 .../src/routes/_pathlessLayout.jsx                 |    17 +
 .../src/routes/_pathlessLayout/_nested-layout.jsx  |    35 +
 .../_pathlessLayout/_nested-layout/route-a.jsx     |    10 +
 .../_pathlessLayout/_nested-layout/route-b.jsx     |    10 +
 .../js-only-file-based/src/routes/index.jsx        |    14 +
 .../src/routes/posts.$postId.jsx                   |    28 +
 .../js-only-file-based/src/routes/posts.index.jsx  |    10 +
 .../js-only-file-based/src/routes/posts.route.jsx  |    40 +
 e2e/react-router/js-only-file-based/src/styles.css |    21 +
 .../js-only-file-based/tests/app.spec.ts           |    35 +
 .../js-only-file-based/tests/setup/global.setup.ts |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 e2e/react-router/js-only-file-based/tsconfig.json  |    14 +
 e2e/react-router/js-only-file-based/vite.config.js |    14 +
 .../rspack-basic-file-based/.gitignore             |    21 +
 e2e/react-router/rspack-basic-file-based/README.md |     6 +
 .../rspack-basic-file-based/package.json           |    32 +
 .../rspack-basic-file-based/playwright.config.ts   |    41 +
 .../rspack-basic-file-based/postcss.config.mjs     |     5 +
 .../rspack-basic-file-based/rsbuild.config.ts      |    17 +
 .../rspack-basic-file-based/src/app.tsx            |    24 +
 .../rspack-basic-file-based/src/env.d.ts           |     1 +
 .../rspack-basic-file-based/src/index.tsx          |    14 +
 .../rspack-basic-file-based/src/posts.tsx          |    36 +
 .../rspack-basic-file-based/src/routes/__root.tsx  |    62 +
 .../rspack-basic-file-based/src/routes/_layout.tsx |    17 +
 .../src/routes/_layout/_layout-2.tsx               |    35 +
 .../src/routes/_layout/_layout-2/layout-a.tsx      |     8 +
 .../src/routes/_layout/_layout-2/layout-b.tsx      |     8 +
 .../rspack-basic-file-based/src/routes/index.tsx   |    14 +
 .../src/routes/posts.$postId.tsx                   |    29 +
 .../src/routes/posts.index.tsx                     |    10 +
 .../rspack-basic-file-based/src/routes/posts.tsx   |    40 +
 .../rspack-basic-file-based/src/styles.css         |    23 +
 .../rspack-basic-file-based/tests/app.spec.ts      |    33 +
 .../tests/setup/global.setup.ts                    |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 .../rspack-basic-file-based/tsconfig.json          |    17 +
 .../.gitignore                                     |    21 +
 .../README.md                                      |     6 +
 .../package.json                                   |    33 +
 .../playwright.config.ts                           |    41 +
 .../postcss.config.mjs                             |     5 +
 .../routes.ts                                      |    22 +
 .../rsbuild.config.ts                              |    18 +
 .../src/app.tsx                                    |    24 +
 .../src/env.d.ts                                   |     1 +
 .../src/index.tsx                                  |    14 +
 .../src/posts.tsx                                  |    38 +
 .../src/routes/a.tsx                               |     8 +
 .../src/routes/b.tsx                               |     8 +
 .../src/routes/file-based-subtree/hello/index.tsx  |     4 +
 .../src/routes/file-based-subtree/hello/route.tsx  |    28 +
 .../routes/file-based-subtree/hello/universe.tsx   |     4 +
 .../src/routes/file-based-subtree/hello/world.tsx  |     4 +
 .../src/routes/home.tsx                            |    14 +
 .../src/routes/layout/first-layout.tsx             |    17 +
 .../src/routes/layout/second-layout.tsx            |    35 +
 .../src/routes/posts/posts-detail.tsx              |    29 +
 .../src/routes/posts/posts-home.tsx                |    10 +
 .../src/routes/posts/posts.tsx                     |    40 +
 .../src/routes/root.tsx                            |    70 +
 .../src/styles.css                                 |    23 +
 .../tests/app.spec.ts                              |    36 +
 .../tests/setup/global.setup.ts                    |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 .../tsconfig.json                                  |    17 +
 .../tsr.config.json                                |     5 +
 .../scroll-restoration-sandbox-vite/.gitignore     |     7 +
 .../scroll-restoration-sandbox-vite/README.md      |    16 +
 .../scroll-restoration-sandbox-vite/index.html     |    12 +
 .../scroll-restoration-sandbox-vite/package.json   |    37 +
 .../playwright.browser.config.ts                   |    47 +
 .../playwright.hash.config.ts                      |    45 +
 .../postcss.config.mjs                             |     5 +
 .../scroll-restoration-sandbox-vite/src/main.tsx   |    37 +
 .../scroll-restoration-sandbox-vite/src/posts.tsx  |    41 +
 .../src/routeTree.gen.ts                           |   181 +
 .../src/routes/(tests)/lazy-page.lazy.tsx          |    18 +
 .../src/routes/(tests)/lazy-page.tsx               |     2 +
 .../routes/(tests)/lazy-with-loader-page.lazy.tsx  |    16 +
 .../src/routes/(tests)/lazy-with-loader-page.tsx   |     9 +
 .../src/routes/(tests)/normal-page.tsx             |    18 +
 .../src/routes/(tests)/page-with-search.tsx        |    19 +
 .../src/routes/(tests)/virtual-page.lazy.tsx       |    18 +
 .../src/routes/-components/scroll-block.tsx        |    16 +
 .../src/routes/__root.tsx                          |    62 +
 .../src/routes/index.tsx                           |    38 +
 .../scroll-restoration-sandbox-vite/src/styles.css |    21 +
 .../tests/app.spec.ts                              |    66 +
 .../tests/setup/global.setup.ts                    |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 .../scroll-restoration-sandbox-vite/tsconfig.json  |    15 +
 .../scroll-restoration-sandbox-vite/vite.config.js |     8 +
 e2e/react-router/sentry-integration/.gitignore     |    11 +
 e2e/react-router/sentry-integration/index.html     |    12 +
 e2e/react-router/sentry-integration/package.json   |    34 +
 .../sentry-integration/playwright.config.ts        |    34 +
 .../sentry-integration/postcss.config.mjs          |     5 +
 e2e/react-router/sentry-integration/src/main.tsx   |    92 +
 e2e/react-router/sentry-integration/src/styles.css |    21 +
 .../sentry-integration/tests/app.spec.ts           |    10 +
 e2e/react-router/sentry-integration/tsconfig.json  |    14 +
 e2e/react-router/sentry-integration/vite.config.js |     8 +
 e2e/react-router/view-transitions/.gitignore       |    10 +
 .../view-transitions/.vscode/settings.json         |    11 +
 e2e/react-router/view-transitions/README.md        |     6 +
 e2e/react-router/view-transitions/index.html       |    12 +
 e2e/react-router/view-transitions/package.json     |    34 +
 .../view-transitions/playwright.config.ts          |    41 +
 .../view-transitions/postcss.config.mjs            |     5 +
 e2e/react-router/view-transitions/src/main.tsx     |    55 +
 e2e/react-router/view-transitions/src/posts.tsx    |    32 +
 .../view-transitions/src/routeTree.gen.ts          |   171 +
 .../view-transitions/src/routes/__root.tsx         |    47 +
 .../view-transitions/src/routes/explore.tsx        |    31 +
 .../view-transitions/src/routes/how-it-works.tsx   |    32 +
 .../view-transitions/src/routes/index.tsx          |    25 +
 .../view-transitions/src/routes/posts.$postId.tsx  |    29 +
 .../view-transitions/src/routes/posts.index.tsx    |    10 +
 .../view-transitions/src/routes/posts.route.tsx    |    44 +
 e2e/react-router/view-transitions/src/styles.css   |   114 +
 .../view-transitions/tests/app.spec.ts             |    10 +
 .../view-transitions/tests/setup/global.setup.ts   |     6 +
 .../tests/setup/global.teardown.ts                 |     6 +
 e2e/react-router/view-transitions/tsconfig.json    |    14 +
 e2e/react-router/view-transitions/vite.config.js   |    14 +
 e2e/react-start/basic-auth/.env                    |     7 +
 e2e/react-start/basic-auth/.gitignore              |    20 +
 e2e/react-start/basic-auth/.prettierignore         |     4 +
 e2e/react-start/basic-auth/dev.db                  |   Bin 0 -> 24576 bytes
 e2e/react-start/basic-auth/package.json            |    43 +
 e2e/react-start/basic-auth/playwright.config.ts    |    34 +
 e2e/react-start/basic-auth/postcss.config.mjs      |     5 +
 e2e/react-start/basic-auth/prisma.config.ts        |    12 +
 .../migrations/20240811183753_init/migration.sql   |     8 +
 .../prisma/migrations/migration_lock.toml          |     3 +
 e2e/react-start/basic-auth/prisma/schema.prisma    |    16 +
 .../basic-auth/public/android-chrome-192x192.png   |   Bin 0 -> 29964 bytes
 .../basic-auth/public/android-chrome-512x512.png   |   Bin 0 -> 109271 bytes
 .../basic-auth/public/apple-touch-icon.png         |   Bin 0 -> 27246 bytes
 .../basic-auth/public/favicon-16x16.png            |   Bin 0 -> 832 bytes
 .../basic-auth/public/favicon-32x32.png            |   Bin 0 -> 2115 bytes
 e2e/react-start/basic-auth/public/favicon.ico      |   Bin 0 -> 15406 bytes
 e2e/react-start/basic-auth/public/favicon.png      |   Bin 0 -> 1507 bytes
 e2e/react-start/basic-auth/public/site.webmanifest |    19 +
 e2e/react-start/basic-auth/src/components/Auth.tsx |    57 +
 .../src/components/DefaultCatchBoundary.tsx        |    53 +
 .../basic-auth/src/components/Login.tsx            |    71 +
 .../basic-auth/src/components/NotFound.tsx         |    25 +
 .../basic-auth/src/hooks/useMutation.ts            |    44 +
 .../basic-auth/src/prisma-generate

... [stdout truncated: output exceeded 50000 characters (396781 total). Please modify your command to reduce output size, for example by:
- Using grep/rg to filter results
- Using head/tail to limit lines
- Using --max-count flag with grep/rg
- Processing output with awk/sed to extract only needed information]

stderr:

fatal: bad revision 'd239a207f~1'

</shell_result>


Script executed:

#!/bin/bash
# Check the actual commit for h3 version change
echo "=== Current h3 version in start-server-core ==="
rg -n '"h3-v2"' packages/start-server-core/package.json

echo -e "\n=== Check if there are other files that might document h3 internals ==="
rg -n "event\.res|event\._res" packages/start-server-core/src/ --type ts

echo -e "\n=== Look at the broader context of server-functions-handler error handling ==="
sed -n '295,320p' packages/start-server-core/src/server-functions-handler.ts

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

stdout:

=== Current h3 version in start-server-core ===
82:    "h3-v2": "npm:h3@2.0.0-beta.4",

=== Check if there are other files that might document h3 internals ===
packages/start-server-core/src/request-response.ts:140:    event.res.headers.set(name, value)
packages/start-server-core/src/request-response.ts:146:  return event.res.headers
packages/start-server-core/src/request-response.ts:153:  return event.res.headers.get(name) || undefined
packages/start-server-core/src/request-response.ts:162:    event.res.headers.delete(name)
packages/start-server-core/src/request-response.ts:164:      event.res.headers.append(name, valueItem)
packages/start-server-core/src/request-response.ts:167:    event.res.headers.set(name, value)
packages/start-server-core/src/request-response.ts:172:  event.res.headers.delete(name)
packages/start-server-core/src/request-response.ts:182:      event.res.headers.delete(name)
packages/start-server-core/src/request-response.ts:186:    for (const name of event.res.headers.keys()) {
packages/start-server-core/src/request-response.ts:187:      event.res.headers.delete(name)
packages/start-server-core/src/request-response.ts:199:    event.res.status = h3_sanitizeStatusCode(code, event.res.status)
packages/start-server-core/src/request-response.ts:202:    event.res.statusText = h3_sanitizeStatusMessage(text)
packages/start-server-core/src/request-response.ts:330:  return event._res

=== Look at the broader context of server-functions-handler error handling ===
        await Promise.resolve(
          toCrossJSONAsync(error, {
            refs: new Map(),
            plugins: serovalPlugins,
          }),
        ),
      )
      const response = getResponse()
      return new Response(serializedError, {
        status: response?.status ?? 500,
        statusText: response?.statusText,
        headers: {
          'Content-Type': 'application/json',
          [X_TSS_SERIALIZED]: 'true',
        },
      })
    }
  })()

  request.signal.removeEventListener('abort', abort)

  return response
}

function isNotFoundResponse(error: any) {
  const { headers, ...rest } = error

</shell_result>


h3 H3Event event._res event.res difference h3@2.0.0


<web_search_result>
Short answer: event._res is an internal (implementation) response object used by H3/srvx; event.res is the public "prepared response" API you should use (status, statusText, headers, etc.). In v2 H3 hid/changed internals (event._res and event.res._headers) — don't rely on _res (it's internal/unstable); use event.res and return values instead. [1][2]

Sources:

  • H3Event API (event.res = prepared response). [1]
  • H3 v2 release notes / changelog (internal event._res and event.res._headers were hidden). [2]
    </web_search_result>

Script executed:

#!/bin/bash
# Search for test files related to getResponse
find packages/start-server-core -name "*.test.*" -o -name "*.spec.*" | xargs grep -l "getResponse" 2>/dev/null

echo -e "\n=== Look for Response usage in server-functions-handler ==="
rg -n "new Response" packages/start-server-core/src/server-functions-handler.ts -B 5 -A 5 | head -60

echo -e "\n=== Check what h3_toResponse does ==="
rg -n "h3_toResponse" packages/start-server-core/src/ -B 2 -A 2

Repository: TanStack/router


<shell_result>
Repository: TanStack/router
Exit code: 0

stdout:


=== Look for Response usage in server-functions-handler ===
174-      //   } as any)
175-
176-      //   sendStream(event, response)
177-      //   event._handled = true
178-
179:      //   return new Response(null, { status: 200 })
180-      // }
181-
182-      if (isNotFound(result)) {
183-        return isNotFoundResponse(result)
184-      }
--
216-          onError: (error) => {
217-            callbacks.onError(error)
218-          },
219-        })
220-        if (done) {
221:          return new Response(
222-            nonStreamingBody ? JSON.stringify(nonStreamingBody) : undefined,
223-            {
224-              status: response?.status,
225-              statusText: response?.statusText,
226-              headers: {
--
248-            if (nonStreamingBody !== undefined) {
249-              callbacks.onParse(nonStreamingBody)
250-            }
251-          },
252-        })
253:        return new Response(stream, {
254-          status: response?.status,
255-          statusText: response?.statusText,
256-          headers: {
257-            'Content-Type': 'application/x-ndjson',
258-            [X_TSS_SERIALIZED]: 'true',
259-          },
260-        })
261-      }
262-
263:      return new Response(undefined, {
264-        status: response?.status,
265-        statusText: response?.statusText,
266-      })
267-    } catch (error: any) {
268-      if (error instanceof Response) {
--
298-            plugins: serovalPlugins,
299-          }),
300-        ),
301-      )
302-      const response = getResponse()
303:      return new Response(serializedError, {
304-        status: response?.status ?? 500,
305-        statusText: response?.statusText,
306-        headers: {
307-          'Content-Type': 'application/json',
308-          [X_TSS_SERIALIZED]: 'true',
--
317-}
318-

=== Check what h3_toResponse does ===
packages/start-server-core/src/request-response.ts-16-  sealSession as h3_sealSession,
packages/start-server-core/src/request-response.ts-17-  setCookie as h3_setCookie,
packages/start-server-core/src/request-response.ts:18:  toResponse as h3_toResponse,
packages/start-server-core/src/request-response.ts-19-  unsealSession as h3_unsealSession,
packages/start-server-core/src/request-response.ts-20-  updateSession as h3_updateSession,
--
packages/start-server-core/src/request-response.ts-56-      handler(request, requestOpts),
packages/start-server-core/src/request-response.ts-57-    )
packages/start-server-core/src/request-response.ts:58:    return h3_toResponse(response, h3Event)
packages/start-server-core/src/request-response.ts-59-  }
packages/start-server-core/src/request-response.ts-60-}

</shell_result>


getResponse() returns an internal h3 property that is not synchronized with where response status is actually written; verify event._res is the correct object to return or switch to event.res

The review concern is valid. The code has an inconsistency:

  • setResponseStatus() (lines 196–204) writes to event.res.status and event.res.statusText
  • getResponse() (line 330) returns event._res (a different object)
  • Multiple call sites in server-functions-handler.ts (lines 186, 224–225, 254–255, 264–265, 302–305) read response?.status and response?.statusText from the returned value

Per h3's v2 documentation, event._res is an internal implementation detail that h3 explicitly hides in v2.x releases, while event.res is the public API. Since setResponseStatus() modifies event.res, returning event._res creates a synchronization risk where status/statusText values could diverge.

Recommendation: Either switch getResponse() to return event.res (the public API where status is actually managed) or add a comment explaining why event._res must be used and verify under h3@2.0.0-beta.4 that both objects stay synchronized.

🤖 Prompt for AI Agents
In packages/start-server-core/src/request-response.ts around lines 327 to 331,
getResponse() returns event._res which is an internal h3 implementation detail
and is inconsistent with setResponseStatus() that writes to event.res; change
getResponse() to return event.res so callers read the public, synchronized
response object (or if there's a deliberate reason to use _res, add a clear
comment explaining why and add a runtime check/assert that event._res and
event.res are synchronized under the targeted h3 version); update any related
call sites to rely on event.res if necessary.

@birkskyum birkskyum changed the title Revert "chore: bump h3-v2 to 2.0.1-rc.5" fix(start-server-core): h3 2.0.0-beta.5 Nov 26, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 26, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5973

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5973

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5973

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5973

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5973

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5973

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5973

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5973

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5973

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5973

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5973

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5973

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5973

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5973

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5973

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5973

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5973

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5973

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5973

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5973

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5973

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5973

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5973

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@5973

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5973

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5973

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5973

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5973

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5973

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5973

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5973

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5973

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5973

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5973

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5973

commit: b2e6482

@birkskyum birkskyum merged commit 8323bf2 into main Nov 26, 2025
6 checks passed
@birkskyum birkskyum deleted the revert-5959-chore--bump-h3-v2-to-2.0.1-rc.5 branch November 26, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants