Skip to content
Source
Sign inSign up
TanStack/router

fix: not all pages are pre-rendered #5475

MergedFatahChan(GitHub profile, opens in a new tab)merged 38 commits intomain fromrefs/pull/5475/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Fixes #5455

Previously, when prerendering was enabled without specifying pages, only the root path (/) was prerendered plus whatever was crawled from the / if crawlLinks is enabled. This change automatically discovers and prerenders all static routes.

Changes

Core Prerendering Improvements

  • Automatic static path discovery: Added logic to discover all static routes
  • Enhanced filtering: Added getPrerenderablePaths() function that filters out:
    • Layout routes (starting with _)
    • Dynamic routes (containing $) - excluded from discovery, but if a link exists to the dynamic route and crawlLinks is enabled then it will also be prerendered
    • Routes without components
  • Improved redirect handling: Added proper redirect following during prerendering

E2E Testing

  • New test suite: Added comprehensive basic-prerendering e2e test
  • Dummy server management: Created scripts to manage dummy servers for API testing during prerendering
  • API data fetching: Fixed issue where API calls failed during prerendering in test mode
  • Content verification: Tests verify that prerendered content is correctly generated

Technical Details

  • Uses GeneratorPlugin to discover route structure
  • Filters routes based on isNonPath, dynamic parameters, and component existence
  • Maintains backward compatibility - existing page specifications still work
  • Added redirect count limit and proper redirect handling

Expected Behavior

When prerender.enabled: true && prerender.autoStaticPathsDiscovery: true (default: true) :

  • ✅ All static routes are automatically discovered and merged with specified pages if any
  • ✅ Dynamic routes are excluded from discovery (but can still be prerendered via crawlLinks if linked)
  • ✅ Layout routes are excluded (as expected)
  • ✅ API routes are excluded (as expected)
  • ✅ Routes with API dependencies work correctly during prerendering

This brings TanStack Start's prerendering behavior in line with Next.js where all static routes are automatically prerendered by default.

Testing

The new basic-prerendering e2e test verifies:

  • Static routes are automatically discovered and prerendered
  • Prerendered HTML contains the expected content
  • API data fetching works correctly during prerendering
  • Routes that require external data sources are properly handled

Breaking Changes

None - this change is fully backward compatible. Existing page specifications continue to work exactly as before.

Migration Guide

No migration needed. Users who previously had to manually specify all static routes can now simply use:

tanstackStart({
  prerender: {
    enabled: true,
    // No need to specify pages - all static routes will be discovered automatically
  }
})

Summary by CodeRabbit

  • New Features

    • Prerendering: automatic static-route discovery (merged with configured pages), configurable maxRedirects and failOnError, crawl-linked-pages support, improved redirect handling and tracking of prerendered pages; router plugin now conditionally enables prerendering and a helper to infer full paths is exported.
    • Exposes discovered prerenderable paths globally for tooling.
  • Documentation

    • Expanded prerender guides with Automatic Static Route Discovery, Crawling Links, examples and updated notes.
  • Tests

    • Added prerender test mode, new npm scripts, Playwright helpers and E2E prerender verification tests.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-plugin-core

    2. Walkthrough

      Adds automatic static-route discovery via a generator plugin and global, extends prerender config with autoStaticPathsDiscovery, maxRedirects, and failOnError, enhances prerender engine to follow internal redirects and track prerendered pages, exposes inferFullPath, and updates docs, e2e tests, and scripts for a prerender mode.

      Changes

      Cohort / File(s)Summary
      Docs updates
      docs/start/framework/react/guide/static-prerendering.md, docs/start/framework/solid/guide/static-prerendering.md
      Document new prerender options (autoStaticPathsDiscovery, maxRedirects, failOnError); add Automatic Static Route Discovery and Crawling Links sections; clarify merging behavior with pages.
      Core prerender engine
      packages/start-plugin-core/src/prerender.ts
      Initialize pages to / when none; merge globalThis.TSS_PRERENDABLE_PATHS when autoStaticPathsDiscovery enabled; add prerendered tracking; enhance internal localFetch to follow internal redirects up to maxRedirects (warn on external or exhausted redirects); return prerendered paths.
      Schema / types
      packages/start-plugin-core/src/schema.ts
      Add optional autoStaticPathsDiscovery?: boolean and maxRedirects?: number to prerender schema and input types.
      Start-router plugin integration
      packages/start-plugin-core/src/start-router-plugin/plugin.ts
      Conditionally register prerenderRoutesPlugin() when prerender enabled; make plugin list dynamic.
      Generator plugin & globals
      packages/start-plugin-core/src/start-router-plugin/generator-plugins/prerender-routes-plugin.ts, packages/start-plugin-core/src/global.d.ts
      New generator plugin computes prerenderable (static, non-dynamic, has component) paths and assigns globalThis.TSS_PRERENDABLE_PATHS; add global declaration for that variable.
      Router generator exports
      packages/router-generator/src/index.ts
      Export inferFullPath from ./utils (public API addition).
      E2E: prerender mode support & tests
      e2e/react-start/basic/package.json, e2e/react-start/basic/playwright.config.ts, e2e/react-start/basic/vite.config.ts, e2e/react-start/basic/tests/prerendering.spec.ts, e2e/react-start/basic/tests/search-params.spec.ts, e2e/react-start/basic/tests/utils/isPrerender.ts
      Add prerender build/test scripts and isPrerender flag; dynamic webServer command by mode; pass prerender config into plugin when prerendering; add/adjust E2E tests verifying prerendered output and content; add dummy server start/stop scripts.

      Sequence Diagram(s)

      sequenceDiagram
        autonumber
        participant Generator as prerenderRoutesPlugin
        participant Global as globalThis
        participant Core as prerender engine
        participant App as local SSR server
        participant FS as file system
      
        rect rgb(232,240,255)
          Generator->>Generator: compute prerenderable paths (static, non‑dynamic, has component)
          Generator->>Global: set TSS_PRERENDABLE_PATHS
        end
      
        rect rgb(240,255,240)
          Core->>Core: init pages ("/" if none)
          alt autoStaticPathsDiscovery = true
            Core->>Global: read TSS_PRERENDABLE_PATHS
            Core->>Core: merge into pages set (dedupe)
          end
        end
      
        loop for each page
          Core->>App: localFetch(page, maxRedirects)
          alt internal 3xx (<= maxRedirects)
            App-->>Core: 3xx Location: /target
            Core->>App: follow redirect
            App-->>Core: 200 OK
          else external 3xx or redirects exhausted
            Core-->>Core: warn and skip
          end
          Core->>FS: write HTML
          Core->>Core: mark page prerendered
        end
      
        Core-->>Developer: return prerendered paths

      Estimated code review effort

      🎯 4 (Complex) | ⏱️ ~60 minutes

      • Focus review on:
        • packages/start-plugin-core/src/prerender.ts (redirect follow logic, localFetch changes, return shape).
        • packages/start-plugin-core/src/start-router-plugin/generator-plugins/prerender-routes-plugin.ts (filtering and path inference).
        • E2E changes gating on isPrerender and new test scripts.
      • TanStack/router#5441 — docs restructuring that overlaps with added/updated static-prerendering docs.

      Suggested reviewers

      • birkskyum

      Poem

      A rabbit sniffs the route and finds the way, Gathers static paths at break of day, Hops links that stay within our site, not sea, Writes each page and ticks them off with glee, Hop, build, run — small files for you and me. 🐇✨

      Pre-merge checks and finishing touches

      ❌ Failed checks (1 warning)
      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.You can run @coderabbitai generate docstrings to improve docstring coverage.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title Check✅ PassedThe title "fix: not all pages are pre-rendered" accurately summarizes the main change in the PR. The issue #5455 reported that static pages not explicitly listed or linked were missing from prerendering output. This PR directly fixes that problem by automatically discovering all eligible static routes through the new autoStaticPathsDiscovery feature. The title is concise, clear, and specific enough that a teammate scanning the history would immediately understand the primary change relates to fixing prerendering coverage.
      Linked Issues Check✅ PassedThe PR fully addresses all coding requirements from issue #5455. Automatic discovery of static routes is implemented via the new prerenderRoutesPlugin that inspects route structure and stores eligible paths in TSS_PRERENDABLE_PATHS [prerender-routes-plugin.ts, prerender.ts]. Exclusions are properly applied: layout routes (prefix underscore), dynamic routes (containing $), routes without components, and non-path routes are all filtered out [prerender-routes-plugin.ts]. The crawlLinks behavior for linked dynamic routes is preserved as documented. Configuration is added to schema.ts with autoStaticPathsDiscovery and maxRedirects options. Backward compatibility is maintained: explicit page lists continue to work while discovered paths merge with configured pages when the option is enabled.
      Out of Scope Changes Check✅ PassedAll code changes directly relate to implementing the requirements from issue #5455 and the stated PR objectives. Core implementation changes (discovery plugin, schema additions, prerender flow integration) address the core functionality. Documentation updates (react and solid guides) explain the new features and behavior. E2E tests and supporting infrastructure (isPrerender utility, configuration updates, build scripts) are necessary to verify the fix works correctly and represent standard practice for feature PRs. Global variable declarations and utility exports support the discovery mechanism. No changes appear unrelated to the primary objective of automatically discovering and prerendering static routes.
      ✨ Finishing touches
      • 📝 Generate docstrings
        🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Post copyable unit tests in a comment

      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.
    3. View your CI Pipeline Execution ↗ for commit 00a811c79df11121e44be5763b66e66d062bc5c5

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded4m 22sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded1sView ↗

      ☁️ Nx Cloud last updated this comment at 2025-10-25 23:25:55 UTC

    4. More templates

      @tanstack/arktype-adapter

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

      @tanstack/directive-functions-plugin

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

      @tanstack/eslint-plugin-router

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

      @tanstack/history

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

      @tanstack/nitro-v2-vite-plugin

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

      @tanstack/react-router

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

      @tanstack/react-router-devtools

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

      @tanstack/react-router-ssr-query

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

      @tanstack/react-start

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

      @tanstack/react-start-client

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

      @tanstack/react-start-server

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

      @tanstack/router-cli

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

      @tanstack/router-core

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

      @tanstack/router-devtools

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

      @tanstack/router-devtools-core

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

      @tanstack/router-generator

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

      @tanstack/router-plugin

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

      @tanstack/router-ssr-query-core

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

      @tanstack/router-utils

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

      @tanstack/router-vite-plugin

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

      @tanstack/server-functions-plugin

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

      @tanstack/solid-router

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

      @tanstack/solid-router-devtools

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

      @tanstack/solid-router-ssr-query

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

      @tanstack/solid-start

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

      @tanstack/solid-start-client

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

      @tanstack/solid-start-server

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

      @tanstack/start-client-core

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

      @tanstack/start-plugin-core

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

      @tanstack/start-server-core

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

      @tanstack/start-static-server-functions

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

      @tanstack/start-storage-context

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

      @tanstack/valibot-adapter

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

      @tanstack/virtual-file-routes

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

      @tanstack/zod-adapter

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

      commit: 00a811c

    5. Actionable comments posted: 13

      Caution

      Some comments are outside the diff and can’t be posted inline due to platform limitations.

      ⚠️ Outside diff range comments (1)
      packages/start-plugin-core/src/prerender.ts (1)

      251-259: Retry logic is blocked by the seen set — retries won’t requeue

      After a failure, calling addCrawlPageTask(page) is a no-op because seen already contains the path. Remove it from seen (or requeue directly) before retrying.

                 await new Promise((resolve) =>
                   setTimeout(resolve, prerenderOptions.retryDelay),
                 )
                 retriesByPath.set(page.path, retries + 1)
      -          addCrawlPageTask(page)
      +          // Allow requeue on retry
      +          seen.delete(page.path)
      +          addCrawlPageTask(page)

      Alternatively, re-add the task directly to queue without relying on seen.

      🧹 Nitpick comments (19)
      e2e/react-start/basic-prerendering/src/routes/posts.index.tsx (1)

      1-9: LGTM! Clean index route implementation.

      The code correctly implements an index route for /posts/ using TanStack Router conventions. The component is appropriately simple for e2e testing with a data-testid attribute for test selection.

      Optional refinement: Consider adding an explicit return type annotation to PostsIndexComponent for stricter type safety:

      -function PostsIndexComponent() {
      +function PostsIndexComponent(): JSX.Element {
         return <div data-testid="PostsIndexComponent">Select a post.</div>
       }

      This is a minor enhancement as TypeScript already infers the return type correctly.

      e2e/react-start/basic-prerendering/.gitignore (1)

      2-3: Include pnpm lockfile ignore for consistency

      We’re ignoring package-lock.json and yarn.lock, but not pnpm-lock.yaml. If these fixtures remain package-manager agnostic, please add pnpm-lock.yaml to avoid committing that lockfile accidentally.

      e2e/react-start/basic-prerendering/src/routes/posts_.$postId.deep.tsx (1)

      11-13: Consider removing the wrapper component.

      PostDeepErrorComponent is a simple pass-through wrapper that doesn't add any value. You can directly use ErrorComponent in the route definition instead.

      Apply this diff to simplify the error handling:

      -export const Route = createFileRoute('/posts_/$postId/deep')({
      -  loader: async ({ params: { postId } }) => fetchPost({ data: postId }),
      -  errorComponent: PostDeepErrorComponent,
      -  component: PostDeepComponent,
      -})
      -
      -function PostDeepErrorComponent({ error }: ErrorComponentProps) {
      -  return <ErrorComponent error={error} />
      -}
      +export const Route = createFileRoute('/posts_/$postId/deep')({
      +  loader: async ({ params: { postId } }) => fetchPost({ data: postId }),
      +  errorComponent: ErrorComponent,
      +  component: PostDeepComponent,
      +})

      Remove the unused import if no longer needed:

      -import { ErrorComponent, Link, createFileRoute } from '@tanstack/react-router'
      -import type { ErrorComponentProps } from '@tanstack/react-router'
      +import { ErrorComponent, Link, createFileRoute } from '@tanstack/react-router'
      e2e/react-start/basic-prerendering/src/utils/seo.ts (2)

      1-11: Add explicit return type annotation for better type safety.

      The function lacks an explicit return type, which reduces type safety and makes the API less clear to consumers.

      Apply this diff to add an explicit return type:

      +type MetaTag = 
      +  | { title: string }
      +  | { name: string; content: string | undefined }
      +
       export const seo = ({
         title,
         description,
         keywords,
         image,
       }: {
         title: string
         description?: string
         image?: string
         keywords?: string
      -}) => {
      +}): MetaTag[] => {

      Note: If you apply the filter suggestion from the previous comment, adjust the type to remove | undefined from content:

      type MetaTag = 
        | { title: string }
        | { name: string; content: string }

      18-19: Hardcoded Twitter handles may need configuration.

      The Twitter creator and site handles are hardcoded as @tannerlinsley. While this might be acceptable for an e2e test scenario, consider whether these should be:

      • Configurable parameters if this utility might be reused
      • Documented as intentionally hardcoded for test purposes

      If configurability is needed, consider adding these as optional parameters with defaults:

       export const seo = ({
         title,
         description,
         keywords,
         image,
      +  twitterCreator = '@tannerlinsley',
      +  twitterSite = '@tannerlinsley',
       }: {
         title: string
         description?: string
         image?: string
         keywords?: string
      +  twitterCreator?: string
      +  twitterSite?: string
       }) => {
         const tags = [
           { title },
           { name: 'description', content: description },
           { name: 'keywords', content: keywords },
           { name: 'twitter:title', content: title },
           { name: 'twitter:description', content: description },
      -    { name: 'twitter:creator', content: '@tannerlinsley' },
      -    { name: 'twitter:site', content: '@tannerlinsley' },
      +    { name: 'twitter:creator', content: twitterCreator },
      +    { name: 'twitter:site', content: twitterSite },
           { name: 'og:type', content: 'website' },
           { name: 'og:title', content: title },
           { name: 'og:description', content: description },
      e2e/react-start/basic-prerendering/src/routes/stream.tsx (1)

      49-61: Consider using idiomatic JSX children syntax.

      While the current children prop approach works with Await, the more idiomatic React pattern places children between JSX tags.

      Apply this diff for more idiomatic syntax:

      -      <Await
      -        promise={promise}
      -        children={(promiseData) => (
      +      <Await promise={promise}>
      +        {(promiseData) => (
                 <div className="p-2" data-testid="promise-data">
                   {promiseData}
                   <div data-testid="stream-data">
                     {streamData.map((d) => (
                       <div key={d}>{d}</div>
                     ))}
                   </div>
                 </div>
      -        )}
      -      />
      +        )}
      +      </Await>
      packages/start-plugin-core/src/schema.ts (1)

      189-190: Constrain redirectCount to non-negative integers.

      This count represents a discrete redirect limit; allowing floats or negatives introduces ambiguous behavior downstream. Please tighten the schema with .int().min(0) (or .nonnegative()) so only sensible values pass validation.

      -        redirectCount: z.number().optional(),
      +        redirectCount: z.number().int().min(0).optional(),
      e2e/react-start/basic-prerendering/src/routes/search-params/route.tsx (1)

      3-8: Simplify type assertion.

      The explicit as string type assertion on line 6 is unnecessary since 'world' is already a string literal.

      Apply this diff to remove the redundant type assertion:

      -    return { hello: 'world' as string }
      +    return { hello: 'world' }
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx (1)

      8-15: Clarify fallback behavior for unknown target values.

      The switch statement lacks a default case, which means if target is neither 'internal' nor 'external', the loader completes without redirecting and the component renders. While this may be intentional for testing purposes, consider adding a comment to clarify this fallback behavior or explicitly handle unexpected values.

      Consider adding either a comment or a default case:

         loader: ({ params: { target }, deps: { externalHost, reloadDocument } }) => {
           switch (target) {
             case 'internal':
               throw redirect({ to: '/posts', reloadDocument })
             case 'external':
               throw redirect({ href: externalHost })
      +      // Intentionally allows other target values to render the component
           }
         },

      Or with explicit handling:

         loader: ({ params: { target }, deps: { externalHost, reloadDocument } }) => {
           switch (target) {
             case 'internal':
               throw redirect({ to: '/posts', reloadDocument })
             case 'external':
               throw redirect({ href: externalHost })
      +      default:
      +        // Allow rendering component for testing fallback behavior
      +        break
           }
         },
      e2e/react-start/basic-prerendering/src/routes/scripts.tsx (1)

      5-19: Consider filtering undefined scripts for clarity.

      The conditional script inclusion works correctly, but the scripts array will contain undefined in production. While frameworks typically handle this, it's cleaner to filter out undefined values explicitly.

      Apply this diff for a cleaner implementation:

       export const Route = createFileRoute('/scripts')({
         head: () => ({
      -    scripts: [
      -      {
      -        src: 'script.js',
      -      },
      -      isProd
      -        ? undefined
      -        : {
      -            src: 'script2.js',
      -          },
      -    ],
      +    scripts: [
      +      {
      +        src: 'script.js',
      +      },
      +      ...(!isProd ? [{ src: 'script2.js' }] : []),
      +    ],
         }),
         component: ScriptsComponent,
       })
      e2e/react-start/basic-prerendering/src/routes/deferred.tsx (1)

      40-55: Consider using JSX children instead of the children prop.

      Static analysis tools flag the use of the children prop with Await components. While this works, the canonical React pattern is to use JSX children. Verify whether Await supports JSX children syntax.

      If Await supports JSX children, apply this diff:

       <Suspense fallback={<div>Loading person...</div>}>
         <Await
           promise={deferredPerson}
      -    children={(data) => (
      +  >
      +    {(data) => (
             <div data-testid="deferred-person">
               {data.name} - {data.randomNumber}
             </div>
      -    )}
      +    )}
         />
       </Suspense>
       <Suspense fallback={<div>Loading stuff...</div>}>
         <Await
           promise={deferredStuff}
      -    children={(data) => <h3 data-testid="deferred-stuff">{data}</h3>}
      +  >
      +    {(data) => <h3 data-testid="deferred-stuff">{data}</h3>}
         />
       </Suspense>
      e2e/react-start/basic-prerendering/src/utils/posts.tsx (1)

      5-9: Consider aligning PostType.id with upstream API (number) or coerce to string

      JSONPlaceholder returns numeric ids. Either:

      • Change id to number, or
      • Explicitly coerce to string when returning to avoid downstream surprises.
      -export type PostType = {
      -  id: string
      +export type PostType = {
      +  id: number
         title: string
         body: string
       }

      Or map: return { ...post, id: String(post.id) }.

      packages/start-plugin-core/src/prerender.ts (2)

      92-105: Redirect handling: parse Location and allow https/ports; avoid fragile string replace

      Current checks only handle http://localhost and naive replace. Parse the URL to support https and ports; resolve relative paths cleanly.

      -    if (
      +    if (
             response.status >= 300 &&
             response.status < 400 &&
             response.headers.get('location') &&
             maxRedirects > 0
           ) {
      -      const location = response.headers.get('location')!
      -      if (location.startsWith('http://localhost') || location.startsWith('/')) {
      -        const newUrl = location.replace('http://localhost', '')
      -        return localFetch(newUrl, options, maxRedirects - 1)
      -      } else {
      -        logger.warn(`Skipping redirect to external location: ${location}`)
      -      }
      +      const location = response.headers.get('location')!
      +      try {
      +        const target = new URL(location, url) // resolves relative to current
      +        if (target.hostname === 'localhost') {
      +          const newPath = `${target.pathname}${target.search}${target.hash}`
      +          return localFetch(newPath, options, maxRedirects - 1)
      +        }
      +        logger.warn(`Skipping redirect to external location: ${target.href}`)
      +      } catch {
      +        logger.warn(`Invalid redirect location: ${location}`)
      +      }
           }

      146-146: Reduce log noise when listing pages

      Logging the entire pages array can get verbose. Consider logging count and sample instead.

      -    logger.info(startConfig.pages)
      +    logger.info(`Initial pages to crawl: ${startConfig.pages.length}`)
      e2e/react-start/basic-prerendering/stop-dummy-server.mjs (1)

      6-8: Consider adding error handling.

      The script lacks error handling around e2eStopDummyServer. If the stop operation fails, the error will be unhandled and may not surface clearly in CI logs.

      Consider wrapping the call in a try-catch block:

       console.log('Stopping dummy server...')
      -await e2eStopDummyServer(packageJson.name)
      -console.log('Dummy server stopped successfully!')
      +try {
      +  await e2eStopDummyServer(packageJson.name)
      +  console.log('Dummy server stopped successfully!')
      +} catch (error) {
      +  console.error('Failed to stop dummy server:', error)
      +  process.exit(1)
      +}
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)

      2-2: Consider using named import for zod.

      While this works, the zod documentation recommends using a named import rather than the default export for better tree-shaking and consistency.

      -import z from 'zod'
      +import { z } from 'zod'
      e2e/react-start/basic-prerendering/src/components/NotFound.tsx (1)

      3-3: Improve type safety for children prop.

      The children prop is typed as any, which bypasses TypeScript's type checking.

      Use React.ReactNode for better type safety:

      -export function NotFound({ children }: { children?: any }) {
      +export function NotFound({ children }: { children?: React.ReactNode }) {
      e2e/react-start/basic-prerendering/vite.config.ts (1)

      17-24: Consider exact path matching for the prerender filter.

      The current filter uses includes() which performs substring matching. This could potentially exclude unintended routes if a route path contains any of the excluded strings as a substring (e.g., /my-redirect-page would be excluded because it contains /redirect).

      If this behavior is intentional for this test suite, the current implementation is fine. Otherwise, consider exact path matching:

               filter: (page) =>
                 ![
                   '/this-route-does-not-exist',
                   '/redirect',
                   '/i-do-not-exist',
                   '/not-found/via-beforeLoad',
                   '/not-found/via-loader',
      -          ].some((p) => page.path.includes(p)),
      +          ].includes(page.path),
      e2e/react-start/basic-prerendering/src/routes/redirect/$target.tsx (1)

      2-2: Use named import for z Replace import z from 'zod’ with import { z } from 'zod’ to match the prevalent pattern across the codebase.

      📜 Review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between 294b82aadebe576bb35b2c76de6a06cc70cb1b91 and cea50c6a8e7ad5810d0329fcdbb7c9b2187d1128.

      ⛔ Files ignored due to path filters (8)
      • e2e/react-start/basic-prerendering/public/android-chrome-192x192.png is excluded by !**/*.png
      • e2e/react-start/basic-prerendering/public/android-chrome-512x512.png is excluded by !**/*.png
      • e2e/react-start/basic-prerendering/public/apple-touch-icon.png is excluded by !**/*.png
      • e2e/react-start/basic-prerendering/public/favicon-16x16.png is excluded by !**/*.png
      • e2e/react-start/basic-prerendering/public/favicon-32x32.png is excluded by !**/*.png
      • e2e/react-start/basic-prerendering/public/favicon.ico is excluded by !**/*.ico
      • e2e/react-start/basic-prerendering/public/favicon.png is excluded by !**/*.png
      • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
      📒 Files selected for processing (74)
      • docs/start/framework/react/guide/static-prerendering.md (2 hunks)
      • e2e/react-start/basic-prerendering/.gitignore (1 hunks)
      • e2e/react-start/basic-prerendering/.prettierignore (1 hunks)
      • e2e/react-start/basic-prerendering/package.json (1 hunks)
      • e2e/react-start/basic-prerendering/playwright.config.ts (1 hunks)
      • e2e/react-start/basic-prerendering/postcss.config.mjs (1 hunks)
      • e2e/react-start/basic-prerendering/public/script.js (1 hunks)
      • e2e/react-start/basic-prerendering/public/script2.js (1 hunks)
      • e2e/react-start/basic-prerendering/public/site.webmanifest (1 hunks)
      • e2e/react-start/basic-prerendering/server.js (1 hunks)
      • e2e/react-start/basic-prerendering/src/client.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/components/CustomMessage.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/components/DefaultCatchBoundary.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/components/NotFound.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/components/RedirectOnClick.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/components/throwRedirect.ts (1 hunks)
      • e2e/react-start/basic-prerendering/src/routeTree.gen.ts (1 hunks)
      • e2e/react-start/basic-prerendering/src/router.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/__root.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/_layout.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/api.users.ts (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/deferred.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/inline-scripts.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/links.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/posts.$postId.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/posts.index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/posts.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/posts_.$postId.deep.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-beforeLoad.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-loader.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-useServerFn.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/scripts.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/search-params/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/search-params/loader-throws-redirect.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/search-params/route.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/stream.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/users.index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/users.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/대한민국.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/server.ts (1 hunks)
      • e2e/react-start/basic-prerendering/src/styles/app.css (1 hunks)
      • e2e/react-start/basic-prerendering/src/utils/posts.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/utils/seo.ts (1 hunks)
      • e2e/react-start/basic-prerendering/src/utils/users.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/start-dummy-server.mjs (1 hunks)
      • e2e/react-start/basic-prerendering/stop-dummy-server.mjs (1 hunks)
      • e2e/react-start/basic-prerendering/tailwind.config.mjs (1 hunks)
      • e2e/react-start/basic-prerendering/tests/prerendering.spec.ts (1 hunks)
      • e2e/react-start/basic-prerendering/tests/setup/global.setup.ts (1 hunks)
      • e2e/react-start/basic-prerendering/tests/setup/global.teardown.ts (1 hunks)
      • e2e/react-start/basic-prerendering/tsconfig.json (1 hunks)
      • e2e/react-start/basic-prerendering/vite.config.ts (1 hunks)
      • packages/start-plugin-core/src/prerender.ts (7 hunks)
      • packages/start-plugin-core/src/schema.ts (1 hunks)
      • packages/start-plugin-core/src/start-router-plugin/plugin.ts (1 hunks)
      🧰 Additional context used
      📓 Path-based instructions (7)
      e2e/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Store end-to-end tests under the e2e/ directory

      Files:

      • e2e/react-start/basic-prerendering/tsconfig.json
      • e2e/react-start/basic-prerendering/public/script.js
      • e2e/react-start/basic-prerendering/src/utils/users.tsx
      • e2e/react-start/basic-prerendering/src/routes/대한민국.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/route.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx
      • e2e/react-start/basic-prerendering/public/site.webmanifest
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/loader-throws-redirect.tsx
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here/index.tsx
      • e2e/react-start/basic-prerendering/src/components/NotFound.tsx
      • e2e/react-start/basic-prerendering/src/styles/app.css
      • e2e/react-start/basic-prerendering/public/script2.js
      • e2e/react-start/basic-prerendering/src/utils/seo.ts
      • e2e/react-start/basic-prerendering/src/routes/posts_.$postId.deep.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/index.tsx
      • e2e/react-start/basic-prerendering/tests/setup/global.setup.ts
      • e2e/react-start/basic-prerendering/tailwind.config.mjs
      • e2e/react-start/basic-prerendering/src/routes/users.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.index.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/stream.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/tests/prerendering.spec.ts
      • e2e/react-start/basic-prerendering/src/routes/scripts.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/index.tsx
      • e2e/react-start/basic-prerendering/playwright.config.ts
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx
      • e2e/react-start/basic-prerendering/start-dummy-server.mjs
      • e2e/react-start/basic-prerendering/src/router.tsx
      • e2e/react-start/basic-prerendering/vite.config.ts
      • e2e/react-start/basic-prerendering/src/routes/posts.$postId.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/tests/setup/global.teardown.ts
      • e2e/react-start/basic-prerendering/postcss.config.mjs
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-useServerFn.tsx
      • e2e/react-start/basic-prerendering/src/routes/__root.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx
      • e2e/react-start/basic-prerendering/src/client.tsx
      • e2e/react-start/basic-prerendering/src/routes/inline-scripts.tsx
      • e2e/react-start/basic-prerendering/stop-dummy-server.mjs
      • e2e/react-start/basic-prerendering/src/utils/posts.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.index.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/links.tsx
      • e2e/react-start/basic-prerendering/src/components/CustomMessage.tsx
      • e2e/react-start/basic-prerendering/src/server.ts
      • e2e/react-start/basic-prerendering/src/components/throwRedirect.ts
      • e2e/react-start/basic-prerendering/src/components/RedirectOnClick.tsx
      • e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts
      • e2e/react-start/basic-prerendering/package.json
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target.tsx
      • e2e/react-start/basic-prerendering/src/routes/api.users.ts
      • e2e/react-start/basic-prerendering/server.js
      • e2e/react-start/basic-prerendering/src/components/DefaultCatchBoundary.tsx
      • e2e/react-start/basic-prerendering/src/routes/deferred.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx
      • e2e/react-start/basic-prerendering/src/routes/index.tsx
      • e2e/react-start/basic-prerendering/src/routeTree.gen.ts
      docs/**/*.{md,mdx}

      📄 CodeRabbit inference engine (AGENTS.md)

      Use internal docs links relative to the docs/ folder (e.g., ./guide/data-loading)

      Files:

      • docs/start/framework/react/guide/static-prerendering.md
      docs/{router,start}/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Place router docs under docs/router/ and start framework docs under docs/start/

      Files:

      • docs/start/framework/react/guide/static-prerendering.md
      **/*.{ts,tsx}

      📄 CodeRabbit inference engine (AGENTS.md)

      Use TypeScript in strict mode with extensive type safety across the codebase

      Files:

      • e2e/react-start/basic-prerendering/src/utils/users.tsx
      • e2e/react-start/basic-prerendering/src/routes/대한민국.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/route.tsx
      • packages/start-plugin-core/src/start-router-plugin/plugin.ts
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/loader-throws-redirect.tsx
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here/index.tsx
      • e2e/react-start/basic-prerendering/src/components/NotFound.tsx
      • e2e/react-start/basic-prerendering/src/utils/seo.ts
      • e2e/react-start/basic-prerendering/src/routes/posts_.$postId.deep.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.tsx
      • packages/start-plugin-core/src/schema.ts
      • e2e/react-start/basic-prerendering/src/routes/search-params/index.tsx
      • e2e/react-start/basic-prerendering/tests/setup/global.setup.ts
      • e2e/react-start/basic-prerendering/src/routes/users.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.index.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/stream.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/tests/prerendering.spec.ts
      • e2e/react-start/basic-prerendering/src/routes/scripts.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/index.tsx
      • e2e/react-start/basic-prerendering/playwright.config.ts
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/router.tsx
      • e2e/react-start/basic-prerendering/vite.config.ts
      • e2e/react-start/basic-prerendering/src/routes/posts.$postId.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/tests/setup/global.teardown.ts
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-useServerFn.tsx
      • e2e/react-start/basic-prerendering/src/routes/__root.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx
      • e2e/react-start/basic-prerendering/src/client.tsx
      • e2e/react-start/basic-prerendering/src/routes/inline-scripts.tsx
      • e2e/react-start/basic-prerendering/src/utils/posts.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.index.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/links.tsx
      • e2e/react-start/basic-prerendering/src/components/CustomMessage.tsx
      • e2e/react-start/basic-prerendering/src/server.ts
      • e2e/react-start/basic-prerendering/src/components/throwRedirect.ts
      • e2e/react-start/basic-prerendering/src/components/RedirectOnClick.tsx
      • e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts
      • packages/start-plugin-core/src/prerender.ts
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target.tsx
      • e2e/react-start/basic-prerendering/src/routes/api.users.ts
      • e2e/react-start/basic-prerendering/src/components/DefaultCatchBoundary.tsx
      • e2e/react-start/basic-prerendering/src/routes/deferred.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx
      • e2e/react-start/basic-prerendering/src/routes/index.tsx
      • e2e/react-start/basic-prerendering/src/routeTree.gen.ts
      **/src/routes/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Place file-based routes under src/routes/ directories

      Files:

      • e2e/react-start/basic-prerendering/src/routes/대한민국.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/route.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/loader-throws-redirect.tsx
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts_.$postId.deep.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.index.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/stream.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/routes/scripts.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.$postId.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-useServerFn.tsx
      • e2e/react-start/basic-prerendering/src/routes/__root.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx
      • e2e/react-start/basic-prerendering/src/routes/inline-scripts.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.index.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/links.tsx
      • e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target.tsx
      • e2e/react-start/basic-prerendering/src/routes/api.users.ts
      • e2e/react-start/basic-prerendering/src/routes/deferred.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx
      • e2e/react-start/basic-prerendering/src/routes/index.tsx
      packages/{*-start,start-*}/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Name and place Start framework packages under packages/-start/ or packages/start-/

      Files:

      • packages/start-plugin-core/src/start-router-plugin/plugin.ts
      • packages/start-plugin-core/src/schema.ts
      • packages/start-plugin-core/src/prerender.ts
      **/package.json

      📄 CodeRabbit inference engine (AGENTS.md)

      Use workspace:* protocol for internal dependencies in package.json files

      Files:

      • e2e/react-start/basic-prerendering/package.json
      🧠 Learnings (1)
      📚 Learning: 2025-09-23T17:36:12.598Z
      Learnt from: CR
      PR: TanStack/router#0
      File: AGENTS.md:0-0
      Timestamp: 2025-09-23T17:36:12.598Z
      Learning: Applies to **/*.{ts,tsx} : Use TypeScript in strict mode with extensive type safety across the codebase

      Applied to files:

      • e2e/react-start/basic-prerendering/tsconfig.json
      🧬 Code graph analysis (51)
      e2e/react-start/basic-prerendering/src/routes/search-params/route.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/deferred.tsx (1)
      • Route (18-29)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/index.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts (1)
      • Route (12-32)
      e2e/react-start/basic-prerendering/src/utils/users.tsx (1)
      • User (1-5)
      e2e/react-start/basic-prerendering/src/components/NotFound.tsx (1)
      • NotFound (3-25)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-loader.tsx (1)
      e2e/react-start/basic-prerendering/src/components/throwRedirect.ts (1)
      • throwRedirect (4-23)
      e2e/react-start/basic-prerendering/src/routes/search-params/loader-throws-redirect.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here/index.tsx (1)
      e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/components/NotFound.tsx (5)
      e2e/react-start/basic-cloudflare/src/components/NotFound.tsx (1)
      • NotFound (3-25)
      e2e/react-start/server-routes/src/components/NotFound.tsx (1)
      • NotFound (3-25)
      examples/react/start-basic-cloudflare/src/components/NotFound.tsx (1)
      • NotFound (3-25)
      examples/react/start-basic-cloudflare/src/routes/__root.tsx (1)
      • NotFound (61-61)
      e2e/react-start/basic-cloudflare/src/routes/__root.tsx (1)
      • NotFound (55-55)
      e2e/react-start/basic-prerendering/src/utils/seo.ts (1)
      scripts/llms-generate.mjs (1)
      • title (96-96)
      e2e/react-start/basic-prerendering/src/routes/posts_.$postId.deep.tsx (1)
      e2e/react-start/basic-prerendering/src/utils/posts.tsx (1)
      • fetchPost (17-33)
      e2e/react-start/basic-prerendering/src/routes/posts.tsx (1)
      e2e/react-start/basic-prerendering/src/utils/posts.tsx (1)
      • fetchPosts (35-42)
      e2e/react-start/basic-prerendering/src/routes/search-params/index.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/tests/setup/global.setup.ts (8)
      e2e/react-router/basic-file-based-code-splitting/tests/setup/global.setup.ts (1)
      • setup (4-6)
      e2e/solid-router/basic-file-based/tests/setup/global.setup.ts (1)
      • setup (4-6)
      e2e/react-router/basic-virtual-file-based/tests/setup/global.setup.ts (1)
      • setup (4-6)
      e2e/react-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts (1)
      • setup (4-6)
      e2e/react-router/rspack-basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts (1)
      • setup (4-6)
      e2e/react-router/basic/tests/setup/global.setup.ts (1)
      • setup (4-6)
      e2e/react-router/basic-esbuild-file-based/tests/setup/global.setup.ts (1)
      • setup (4-6)
      e2e/react-router/basic-file-based/tests/setup/global.setup.ts (1)
      • setup (4-6)
      e2e/react-start/basic-prerendering/src/routes/users.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/api.users.ts (1)
      • Route (13-28)
      e2e/react-start/basic-prerendering/src/utils/users.tsx (1)
      • User (1-5)
      examples/solid/start-basic/src/routes/users.tsx (1)
      • UsersComponent (18-48)
      e2e/react-start/basic-prerendering/src/routes/posts.index.tsx (1)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/stream.tsx (1)
      e2e/react-start/basic-prerendering/src/routes/deferred.tsx (1)
      • Route (18-29)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (4)
      e2e/react-start/basic-prerendering/src/routes/__root.tsx (1)
      • Route (16-75)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/scripts.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/inline-scripts.tsx (1)
      • Route (3-18)
      packages/router-core/src/ssr/tsrScript.ts (1)
      • p (7-9)
      e2e/react-start/basic-prerendering/src/routes/redirect/index.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/playwright.config.ts (1)
      scripts/set-ts-version.js (1)
      • packageJson (33-33)
      e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here.tsx (1)
      e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here/index.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/start-dummy-server.mjs (1)
      scripts/set-ts-version.js (1)
      • packageJson (33-33)
      e2e/react-start/basic-prerendering/src/router.tsx (2)
      e2e/react-start/basic-prerendering/src/components/DefaultCatchBoundary.tsx (1)
      • DefaultCatchBoundary (10-53)
      e2e/react-start/basic-prerendering/src/components/NotFound.tsx (1)
      • NotFound (3-25)
      e2e/react-start/basic-prerendering/src/routes/posts.$postId.tsx (2)
      e2e/react-start/basic-prerendering/src/utils/posts.tsx (1)
      • fetchPost (17-33)
      e2e/react-start/basic-prerendering/src/components/NotFound.tsx (1)
      • NotFound (3-25)
      e2e/react-start/basic-prerendering/src/routes/_layout.tsx (4)
      e2e/react-start/basic-prerendering/src/routes/__root.tsx (1)
      • Route (16-75)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/_layout.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-beforeLoad.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/components/throwRedirect.ts (1)
      • throwRedirect (4-23)
      e2e/react-start/basic-prerendering/tests/setup/global.teardown.ts (2)
      e2e/solid-router/basic-file-based/tests/setup/global.teardown.ts (1)
      • teardown (4-6)
      e2e/react-router/generator-cli-only/tests/setup/global.teardown.ts (1)
      • teardown (4-6)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-useServerFn.tsx (1)
      e2e/react-start/basic-prerendering/src/components/RedirectOnClick.tsx (1)
      • RedirectOnClick (10-26)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/_layout.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/inline-scripts.tsx (1)
      packages/router-core/src/ssr/tsrScript.ts (1)
      • p (7-9)
      e2e/react-start/basic-prerendering/stop-dummy-server.mjs (1)
      scripts/set-ts-version.js (1)
      • packageJson (33-33)
      e2e/react-start/basic-prerendering/src/utils/posts.tsx (1)
      e2e/react-router/js-only-file-based/src/posts.js (1)
      • queryURL (5-5)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/users.index.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/__root.tsx (1)
      • Route (16-75)
      e2e/react-start/basic-prerendering/src/routes/_layout.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/index.tsx (1)
      • Route (4-6)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/_layout.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/index.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/__root.tsx (1)
      • Route (16-75)
      e2e/react-start/basic-prerendering/src/routes/index.tsx (1)
      • Route (4-6)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/components/RedirectOnClick.tsx (1)
      e2e/react-start/basic-prerendering/src/components/throwRedirect.ts (1)
      • throwRedirect (4-23)
      e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts (2)
      e2e/react-start/basic-prerendering/src/routes/api.users.ts (1)
      • Route (13-28)
      e2e/react-start/basic-prerendering/src/utils/users.tsx (1)
      • User (1-5)
      packages/start-plugin-core/src/prerender.ts (1)
      packages/router-generator/src/generator.ts (1)
      • getCrawlingResult (1183-1186)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-start/basic-prerendering/src/routes/api.users.ts (2)
      e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts (1)
      • Route (12-32)
      e2e/react-start/basic-prerendering/src/utils/users.tsx (1)
      • User (1-5)
      e2e/react-start/basic-prerendering/src/components/DefaultCatchBoundary.tsx (3)
      e2e/react-start/server-routes/src/components/DefaultCatchBoundary.tsx (1)
      • DefaultCatchBoundary (10-53)
      examples/react/start-basic-cloudflare/src/components/DefaultCatchBoundary.tsx (1)
      • DefaultCatchBoundary (10-53)
      packages/react-router/src/CatchBoundary.tsx (2)
      • CatchBoundaryImpl (31-78)
      • CatchBoundary (5-29)
      e2e/react-start/basic-prerendering/src/routes/deferred.tsx (1)
      e2e/react-start/basic/src/routes/deferred.tsx (1)
      • deferredStuff (19-27)
      e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-router/basic-file-based/src/routes/search-params/default.tsx (1)
      • search (18-27)
      e2e/react-start/basic-prerendering/src/routes/index.tsx (1)
      e2e/react-start/basic-prerendering/src/components/CustomMessage.tsx (1)
      • CustomMessage (3-10)
      e2e/react-start/basic-prerendering/src/routeTree.gen.ts (2)
      e2e/react-router/js-only-file-based/src/routeTree.gen.js (3)
      • IndexRoute (30-34)
      • PostsIndexRoute (35-39)
      • PostsPostIdRoute (40-44)
      e2e/react-start/basic-prerendering/src/router.tsx (1)
      • getRouter (6-16)
      🪛 Biome (2.1.2)
      e2e/react-start/basic-prerendering/src/routes/stream.tsx

      [error] 51-51: Avoid passing children using a prop

      The canonical way to pass children in React is to use JSX elements

      (lint/correctness/noChildrenProp)

      e2e/react-start/basic-prerendering/src/routes/deferred.tsx

      [error] 43-43: Avoid passing children using a prop

      The canonical way to pass children in React is to use JSX elements

      (lint/correctness/noChildrenProp)


      [error] 53-53: Avoid passing children using a prop

      The canonical way to pass children in React is to use JSX elements

      (lint/correctness/noChildrenProp)

      🪛 LanguageTool
      docs/start/framework/react/guide/static-prerendering.md

      [grammar] ~12-~12: There might be a mistake here. Context: ... parameters (e.g., /about, /contact) - Routes with search parameters that have ...

      (QB_NEW_EN)


      [grammar] ~13-~13: There might be a mistake here. Context: ...arch parameters that have default values - Routes that don't require dynamic data f...

      (QB_NEW_EN)

      ⏰ 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
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
    6. Actionable comments posted: 12

      🧹 Nitpick comments (31)
      e2e/react-start/basic-prerendering/.prettierignore (1)

      1-4: Looks good. Optional: ignore Playwright artifacts too.

      Current ignores are sensible for build and generated files. Consider also ignoring Playwright outputs to avoid formatting large reports.

       **/build
       **/public
       pnpm-lock.yaml
       routeTree.gen.ts
      +playwright-report
      +test-results
      e2e/react-start/basic-prerendering/src/server.ts (1)

      7-11: Add explicit return type for improved type safety.

      The fetch method lacks an explicit return type annotation. To align with the strict TypeScript coding guidelines, add the return type.

      As per coding guidelines.

      Apply this diff to add the return type:

       export default {
      -  fetch(request: Request) {
      +  fetch(request: Request): ReturnType<typeof handler.fetch> {
           return handler.fetch(request)
         },
       }
      e2e/react-start/basic-prerendering/.gitignore (3)

      1-4: Include pnpm lockfile (repo uses pnpm).

      To keep lockfile policy consistent, ignore pnpm-lock.yaml alongside npm/yarn locks (or decide to commit locks). Given pnpm usage in this PR, add:

       node_modules
       package-lock.json
       yarn.lock
      +pnpm-lock.yaml

      6-8: Broaden env ignores to prevent secret leaks.

      Ignore all dotenv variants and keep an allowlisted example file.

       .DS_Store
       .cache
      -.env
      +.env
      +.env.*
      +!.env.example
       .vercel
       .output
      @@
       # Sentry Config File
       .env.sentry-build-plugin

      Also applies to: 16-16


      11-20: Add common logs/caches and coverage artifacts.

      These are frequently generated during builds/tests and can clutter diffs.

       /build/
       /api/
       /server/build
       /public/build
       # Sentry Config File
       .env.sentry-build-plugin
       /test-results/
       /playwright-report/
       /blob-report/
       /playwright/.cache/
      +coverage/
      +.nyc_output/
      +*.tsbuildinfo
      +npm-debug.log*
      +yarn-error.log*
      +pnpm-debug.log*
      +node_modules/.vite/
      +.vite/
      +.vscode/
      +.idea/
      +Thumbs.db
      e2e/react-start/basic-prerendering/src/routes/api.users.ts (1)

      7-11: Prefer const and validate VITE_EXTERNAL_PORT in test mode.

      The queryURL variable is declared with let but could be const with a conditional expression. Additionally, VITE_EXTERNAL_PORT is used without validation, which could result in an invalid URL if the environment variable is undefined or malformed in test mode.

      Apply this diff to use const and add validation:

      -let queryURL = 'https://jsonplaceholder.typicode.com'
      -
      -if (import.meta.env.VITE_NODE_ENV === 'test') {
      -  queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}`
      -}
      +const queryURL =
      +  import.meta.env.VITE_NODE_ENV === 'test'
      +    ? `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT || '3000'}`
      +    : 'https://jsonplaceholder.typicode.com'
      packages/start-plugin-core/src/schema.ts (1)

      189-189: Consider adding a minimum constraint to redirectCount.

      The redirectCount field accepts any number, including negative values. To prevent unexpected behavior, consider adding a minimum constraint.

      Apply this diff to add a minimum constraint:

      -        redirectCount: z.number().optional(),
      +        redirectCount: z.number().min(0).optional(),
      e2e/react-start/basic-prerendering/src/utils/users.tsx (1)

      1-9: Consider renaming to .ts extension.

      The file contains only type definitions and constants, with no JSX. Renaming from .tsx to .ts would align with the actual content.

      e2e/react-start/basic-prerendering/src/routes/search-params/route.tsx (1)

      3-8: Consider removing the redundant type assertion.

      The type assertion 'world' as string is unnecessary since 'world' is already inferred as a string literal type.

      Apply this diff:

      -    return { hello: 'world' as string }
      +    return { hello: 'world' }
      e2e/react-start/basic-prerendering/tsconfig.json (1)

      3-21: Add Vite types for import.meta.env

      You reference import.meta.env in TS (e.g., API routes). Add vite/client to types so TS knows ImportMetaEnv.

      Apply this diff:

         "compilerOptions": {
           "strict": true,
           "esModuleInterop": true,
           "jsx": "react-jsx",
           "module": "ESNext",
           "moduleResolution": "Bundler",
           "lib": ["DOM", "DOM.Iterable", "ES2022"],
      +    "types": ["vite/client"],
           "isolatedModules": true,
           "resolveJsonModule": true,
           "skipLibCheck": true,
           "target": "ES2022",
           "allowJs": true,
           "forceConsistentCasingInFileNames": true,
           "baseUrl": ".",
           "paths": {
             "~/*": ["./src/*"]
           },
           "noEmit": true
         }
      e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts (1)

      15-28: Harden the handler (param validation + timeout)

      Optional but useful for tests and robustness:

      • Validate params.id is a positive integer; return 400 on invalid.
      • Add a request timeout to avoid hanging on slow upstreams.

      Example diff:

      -      GET: async ({ request, params }) => {
      +      GET: async ({ request, params }) => {
               console.info(`Fetching users by id=${params.id}... @`, request.url)
               try {
      -          const res = await axios.get<User>(`${queryURL}/users/` + params.id)
      +          const idNum = Number(params.id)
      +          if (!Number.isInteger(idNum) || idNum <= 0) {
      +            return json({ error: 'Invalid id' }, { status: 400 })
      +          }
      +          const res = await axios.get<User>(`${queryURL}/users/${idNum}`, {
      +            timeout: 5000,
      +          })
      e2e/react-start/basic-prerendering/src/routes/deferred.tsx (1)

      40-55: Refactor to use JSX children pattern instead of children prop.

      The Await components use the children prop, which is not the canonical React pattern and is flagged by the linter.

      Apply this diff to use JSX children:

             <Suspense fallback={<div>Loading person...</div>}>
               <Await
                 promise={deferredPerson}
      -          children={(data) => (
      +        >
      +          {(data) => (
                   <div data-testid="deferred-person">
                     {data.name} - {data.randomNumber}
                   </div>
      -          )}
      +          )}
      -        />
      +        </Await>
             </Suspense>
             <Suspense fallback={<div>Loading stuff...</div>}>
               <Await
                 promise={deferredStuff}
      -          children={(data) => <h3 data-testid="deferred-stuff">{data}</h3>}
      +        >
      +          {(data) => <h3 data-testid="deferred-stuff">{data}</h3>}
      -        />
      +        </Await>
             </Suspense>
      e2e/react-start/basic-prerendering/src/routes/stream.tsx (2)

      30-45: Add stream to useEffect dependency array.

      The stream object is referenced inside the effect but not included in the dependency array. While the stream reference is likely stable from the loader, explicitly including it follows React Hook best practices and avoids potential stale closure issues.

      Apply this diff:

           fetchStream()
      -  }, [])
      +  }, [stream])

      47-63: Refactor to use JSX children pattern instead of children prop.

      The Await component uses the children prop, which is not the canonical React pattern and is flagged by the linter.

      Apply this diff:

             <Await
               promise={promise}
      -        children={(promiseData) => (
      +      >
      +        {(promiseData) => (
                 <div className="p-2" data-testid="promise-data">
                   {promiseData}
                   <div data-testid="stream-data">
                     {streamData.map((d) => (
                       <div key={d}>{d}</div>
                     ))}
                   </div>
                 </div>
      -        )}
      +        )}
      -      />
      +      </Await>
      e2e/react-start/basic-prerendering/src/components/NotFound.tsx (1)

      3-3: Replace any type with React.ReactNode for strict type safety.

      The children prop is typed as any, which bypasses TypeScript's type checking. Use React.ReactNode for proper type safety.

      As per coding guidelines

      Apply this diff:

      -export function NotFound({ children }: { children?: any }) {
      +export function NotFound({ children }: { children?: React.ReactNode }) {
      e2e/react-start/basic-prerendering/tests/setup/global.setup.ts (1)

      2-2: Consider using import attributes syntax.

      The with { type: 'json' } syntax is from an older stage-3 proposal. Node.js v20.10+ and TypeScript 5.3+ support the import attributes form, which is now the standardized syntax.

      Apply this diff if your environment supports it:

      -import packageJson from '../../package.json' with { type: 'json' }
      +import packageJson from '../../package.json' with { type: 'json' }

      Note: If the project is targeting older Node versions, the current syntax is acceptable.

      e2e/react-start/basic-prerendering/src/router.tsx (1)

      6-16: Consider consistent component assignment.

      The router configuration is correct. For consistency with defaultErrorComponent, you could simplify defaultNotFoundComponent.

      Apply this diff for consistency:

       export function getRouter() {
         const router = createRouter({
           routeTree,
           scrollRestoration: true,
           defaultPreload: 'intent',
           defaultErrorComponent: DefaultCatchBoundary,
      -    defaultNotFoundComponent: () => <NotFound />,
      +    defaultNotFoundComponent: NotFound,
         })
      
         return router
       }

      Note: Both forms are valid; this is purely a stylistic suggestion.

      e2e/react-start/basic-prerendering/stop-dummy-server.mjs (2)

      4-4: Consider using import attributes syntax.

      The with { type: 'json' } syntax is from an older stage-3 proposal. The standardized import attributes form is now supported in Node.js v20.10+ and TypeScript 5.3+.

      Apply this diff if targeting modern Node versions:

      -import packageJson from './package.json' with { type: 'json' }
      +import packageJson from './package.json' with { type: 'json' }

      Note: The current syntax works but may be deprecated in future Node versions.


      6-8: Add error handling for robustness.

      The script lacks error handling. If e2eStopDummyServer fails, users won't see a clear error message, and the exit code may not reflect the failure.

      Apply this diff to add proper error handling:

       console.log('Stopping dummy server...')
      -await e2eStopDummyServer(packageJson.name)
      -console.log('Dummy server stopped successfully!')
      +try {
      +  await e2eStopDummyServer(packageJson.name)
      +  console.log('Dummy server stopped successfully!')
      +} catch (error) {
      +  console.error('Failed to stop dummy server:', error)
      +  process.exit(1)
      +}
      e2e/react-start/basic-prerendering/src/routes/users.tsx (1)

      7-14: Simplify loader for clarity

      Avoid mixing await with .then/.catch. Use try/catch with a single await.

      -  loader: async () => {
      -    return await axios
      -      .get<Array<User>>('/api/users')
      -      .then((r) => r.data)
      -      .catch(() => {
      -        throw new Error('Failed to fetch users')
      -      })
      -  },
      +  loader: async () => {
      +    try {
      +      const r = await axios.get<Array<User>>('/api/users')
      +      return r.data
      +    } catch {
      +      throw new Error('Failed to fetch users')
      +    }
      +  },
      e2e/react-start/basic-prerendering/playwright.config.ts (1)

      12-12: Improve error handling and cross-platform compatibility in the command chain.

      The ssrModeCommand has two concerns:

      1. No error propagation: If pnpm build fails, the subsequent commands still execute. The chain should abort on failure.
      2. Unix-only syntax: The && operator works on Unix/macOS but may behave differently on Windows in some shells.

      Consider using a dedicated script (e.g., scripts/e2e-setup.sh or .mjs) that provides explicit error handling and cross-platform compatibility:

      // scripts/e2e-setup.mjs
      import { execSync } from 'child_process'
      
      const commands = [
        'pnpm test:e2e:dummyServer',
        'pnpm build',
        'pnpm test:e2e:stopDummyServer',
        'pnpm start'
      ]
      
      for (const cmd of commands) {
        try {
          execSync(cmd, { stdio: 'inherit' })
        } catch (error) {
          console.error(`Command failed: ${cmd}`)
          process.exit(1)
        }
      }

      Then update the config:

      -const ssrModeCommand = `pnpm test:e2e:dummyServer && pnpm build && pnpm test:e2e:stopDummyServer && pnpm start`
      +const ssrModeCommand = 'node scripts/e2e-setup.mjs'
      e2e/react-start/basic-prerendering/package.json (1)

      12-14: Replace Unix-specific commands for cross-platform compatibility.

      The test scripts use Unix-specific syntax (& for backgrounding and rm -rf) that won't work on Windows without WSL or Git Bash.

      Consider using cross-platform alternatives:

      1. For backgrounding processes, use a Node.js script or a tool like concurrently
      2. For file deletion, use a cross-platform utility like rimraf or del-cli

      Example refactor using Node scripts:

         "scripts": {
      -    "test:e2e:dummyServer": "node start-dummy-server.mjs &",
      +    "test:e2e:dummyServer": "node start-dummy-server.mjs",
           "test:e2e:stopDummyServer": "node stop-dummy-server.mjs",
      -    "test:e2e": "rm -rf port*.txt;  pnpm run test:e2e:ssrMode"
      +    "test:e2e": "node -e \"require('fs').readdirSync('.').filter(f=>f.match(/^port.*\\.txt$/)).forEach(f=>require('fs').unlinkSync(f))\" && pnpm run test:e2e:ssrMode"
         },

      Or add rimraf as a devDependency and use:

      -    "test:e2e": "rm -rf port*.txt;  pnpm run test:e2e:ssrMode"
      +    "test:e2e": "rimraf port*.txt && pnpm run test:e2e:ssrMode"
      e2e/react-start/basic-prerendering/src/routes/redirect/$target.tsx (1)

      13-17: Consider making externalHost conditionally required based on the redirect target.

      The externalHost search parameter is optional, but child routes (e.g., via-beforeLoad.tsx) require it when target is 'external'. This creates a validation gap where the route can be accessed with invalid combinations.

      Zod doesn't natively support conditional validation across separate schema fields in this context, but you can add runtime validation in child route beforeLoad hooks or document the requirement clearly. Alternatively, split into separate routes:

      // Option 1: Document the requirement
      export const Route = createFileRoute('/redirect/$target')({
        // ... existing code
        validateSearch: z.object({
          reloadDocument: z.boolean().optional(),
          preload: z.literal(false).optional(),
          // externalHost is required when target is 'external'
          externalHost: z.string().optional(),
        }),

      Or implement validation in each child route as suggested for via-beforeLoad.tsx.

      docs/start/framework/react/guide/static-prerendering.md (1)

      18-21: Remove redundant explanation.

      Line 20 duplicates the automatic discovery explanation already provided in lines 10-16. The Manual Page Configuration section should focus on when and how to manually configure pages.

      Consider this revision:

       ## Manual Page Configuration
       
      -TanStack Start can prerender your application to static HTML files, which can then be served to users without having to generate them on the fly. When prerendering is enabled without specifying pages, TanStack Start will automatically discover and prerender all static routes in your application.
      +You can manually specify which pages to prerender using the `pages` array. This is useful when you need custom output paths or want to override the automatic discovery behavior.
       
       To prerender your application, you can add the `prerender` option to your tanstackStart configuration in `vite.config.ts` file:
      e2e/react-start/basic-prerendering/src/components/RedirectOnClick.tsx (1)

      17-21: Avoid unhandled promise from useServerFn; explicitly ignore or handle it

      onClick returns a Promise that isn’t awaited/caught. Use void to signal intentional fire-and-forget (prevents no-floating-promises).

      -      onClick={() =>
      -        execute({ data: { target, reloadDocument, externalHost } })
      -      }
      +      onClick={() =>
      +        void execute({ data: { target, reloadDocument, externalHost } })
      +      }
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/index.tsx (1)

      6-8: Optional: improve readability by hoisting params

      Slightly clearer to read and avoids calling the hook inline in JSX.

      -        redirect test with server functions (target {Route.useParams().target})
      +        {(() => {
      +          const { target } = Route.useParams()
      +          return <>redirect test with server functions (target {target})</>
      +        })()}
      e2e/react-start/basic-prerendering/server.js (2)

      16-16: Prefer absolute paths for static assets

      Avoid CWD sensitivity by resolving to absolute paths.

      -  app.use(express.static('./dist/client'))
      +  app.use(express.static(path.resolve('./dist/client')))

      Repeat the same change for the other static middleware.

      Also applies to: 48-48


      57-61: Add startup error handling to avoid unhandled rejections

      If dynamic import or binding fails, the promise rejects and nothing logs.

      -createSpaServer().then(async ({ app }) =>
      -  app.listen(port, () => {
      -    console.info(`Client Server: http://localhost:${port}`)
      -  }),
      -)
      +createSpaServer()
      +  .then(({ app }) => {
      +    app.listen(port, () => {
      +      console.info(`Client Server: http://localhost:${port}`)
      +    })
      +  })
      +  .catch((err) => {
      +    console.error('Failed to start SPA server', err)
      +    process.exitCode = 1
      +  })
       
      -createStartServer().then(async ({ app }) =>
      -  app.listen(startPort, () => {
      -    console.info(`Start Server: http://localhost:${startPort}`)
      -  }),
      -)
      +createStartServer()
      +  .then(({ app }) => {
      +    app.listen(startPort, () => {
      +      console.info(`Start Server: http://localhost:${startPort}`)
      +    })
      +  })
      +  .catch((err) => {
      +    console.error('Failed to start Start server', err)
      +    process.exitCode = 1
      +  })

      Also applies to: 63-67

      e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx (1)

      3-15: Route always notFound — consider removing unused component

      Since loader throws notFound unconditionally, the route component won’t render. If not needed for tests, drop the component to reduce dead code; otherwise, add a short comment clarifying the intent.

      e2e/react-start/basic-prerendering/src/routes/__root.tsx (2)

      95-101: Add html lang attribute for accessibility/SEO

      Recommend (or appropriate locale).

      -  return (
      -    <html>
      +  return (
      +    <html lang="en">

      26-31: Use standard theme color meta; remove non-standard 'color' on manifest link

      'color' isn’t a standard attribute for rel="manifest". Prefer a meta tag for theme color.

             ...seo({
               title:
                 'TanStack Start | Type-Safe, Client-First, Full-Stack React Framework',
               description: `TanStack Start is a type-safe, client-first, full-stack React framework. `,
             }),
      +      { name: 'theme-color', content: '#ffffff' },
           ],
      -      { rel: 'manifest', href: '/site.webmanifest', color: '#fffff' },
      +      { rel: 'manifest', href: '/site.webmanifest' },

      Also applies to: 51-53

      📜 Review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between 294b82aadebe576bb35b2c76de6a06cc70cb1b91 and 773c94bcdcecee4df71c8e8736493f89d38d3e3d.

      ⛔ Files ignored due to path filters (8)
      • e2e/react-start/basic-prerendering/public/android-chrome-192x192.png is excluded by !**/*.png
      • e2e/react-start/basic-prerendering/public/android-chrome-512x512.png is excluded by !**/*.png
      • e2e/react-start/basic-prerendering/public/apple-touch-icon.png is excluded by !**/*.png
      • e2e/react-start/basic-prerendering/public/favicon-16x16.png is excluded by !**/*.png
      • e2e/react-start/basic-prerendering/public/favicon-32x32.png is excluded by !**/*.png
      • e2e/react-start/basic-prerendering/public/favicon.ico is excluded by !**/*.ico
      • e2e/react-start/basic-prerendering/public/favicon.png is excluded by !**/*.png
      • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
      📒 Files selected for processing (74)
      • docs/start/framework/react/guide/static-prerendering.md (2 hunks)
      • e2e/react-start/basic-prerendering/.gitignore (1 hunks)
      • e2e/react-start/basic-prerendering/.prettierignore (1 hunks)
      • e2e/react-start/basic-prerendering/package.json (1 hunks)
      • e2e/react-start/basic-prerendering/playwright.config.ts (1 hunks)
      • e2e/react-start/basic-prerendering/postcss.config.mjs (1 hunks)
      • e2e/react-start/basic-prerendering/public/script.js (1 hunks)
      • e2e/react-start/basic-prerendering/public/script2.js (1 hunks)
      • e2e/react-start/basic-prerendering/public/site.webmanifest (1 hunks)
      • e2e/react-start/basic-prerendering/server.js (1 hunks)
      • e2e/react-start/basic-prerendering/src/client.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/components/CustomMessage.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/components/DefaultCatchBoundary.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/components/NotFound.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/components/RedirectOnClick.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/components/throwRedirect.ts (1 hunks)
      • e2e/react-start/basic-prerendering/src/routeTree.gen.ts (1 hunks)
      • e2e/react-start/basic-prerendering/src/router.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/__root.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/_layout.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/api.users.ts (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/deferred.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/inline-scripts.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/links.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/posts.$postId.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/posts.index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/posts.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/posts_.$postId.deep.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-beforeLoad.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-loader.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-useServerFn.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/redirect/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/scripts.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/search-params/index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/search-params/loader-throws-redirect.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/search-params/route.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/stream.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/users.index.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/users.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/routes/대한민국.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/server.ts (1 hunks)
      • e2e/react-start/basic-prerendering/src/styles/app.css (1 hunks)
      • e2e/react-start/basic-prerendering/src/utils/posts.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/src/utils/seo.ts (1 hunks)
      • e2e/react-start/basic-prerendering/src/utils/users.tsx (1 hunks)
      • e2e/react-start/basic-prerendering/start-dummy-server.mjs (1 hunks)
      • e2e/react-start/basic-prerendering/stop-dummy-server.mjs (1 hunks)
      • e2e/react-start/basic-prerendering/tailwind.config.mjs (1 hunks)
      • e2e/react-start/basic-prerendering/tests/prerendering.spec.ts (1 hunks)
      • e2e/react-start/basic-prerendering/tests/setup/global.setup.ts (1 hunks)
      • e2e/react-start/basic-prerendering/tests/setup/global.teardown.ts (1 hunks)
      • e2e/react-start/basic-prerendering/tsconfig.json (1 hunks)
      • e2e/react-start/basic-prerendering/vite.config.ts (1 hunks)
      • packages/start-plugin-core/src/prerender.ts (8 hunks)
      • packages/start-plugin-core/src/schema.ts (1 hunks)
      • packages/start-plugin-core/src/start-router-plugin/plugin.ts (1 hunks)
      🧰 Additional context used
      📓 Path-based instructions (7)
      **/*.{ts,tsx}

      📄 CodeRabbit inference engine (AGENTS.md)

      Use TypeScript in strict mode with extensive type safety across the codebase

      Files:

      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/inline-scripts.tsx
      • packages/start-plugin-core/src/prerender.ts
      • e2e/react-start/basic-prerendering/src/client.tsx
      • e2e/react-start/basic-prerendering/src/server.ts
      • e2e/react-start/basic-prerendering/src/routes/search-params/loader-throws-redirect.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here/index.tsx
      • packages/start-plugin-core/src/start-router-plugin/plugin.ts
      • e2e/react-start/basic-prerendering/tests/setup/global.setup.ts
      • e2e/react-start/basic-prerendering/src/components/NotFound.tsx
      • e2e/react-start/basic-prerendering/src/routes/대한민국.tsx
      • e2e/react-start/basic-prerendering/src/components/RedirectOnClick.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.tsx
      • packages/start-plugin-core/src/schema.ts
      • e2e/react-start/basic-prerendering/src/utils/users.tsx
      • e2e/react-start/basic-prerendering/src/components/CustomMessage.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.$postId.tsx
      • e2e/react-start/basic-prerendering/src/routes/deferred.tsx
      • e2e/react-start/basic-prerendering/src/components/DefaultCatchBoundary.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout.tsx
      • e2e/react-start/basic-prerendering/src/utils/posts.tsx
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts_.$postId.deep.tsx
      • e2e/react-start/basic-prerendering/tests/setup/global.teardown.ts
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/components/throwRedirect.ts
      • e2e/react-start/basic-prerendering/src/routes/__root.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts
      • e2e/react-start/basic-prerendering/src/routes/stream.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-useServerFn.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.index.tsx
      • e2e/react-start/basic-prerendering/tests/prerendering.spec.ts
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx
      • e2e/react-start/basic-prerendering/src/routes/links.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx
      • e2e/react-start/basic-prerendering/vite.config.ts
      • e2e/react-start/basic-prerendering/src/utils/seo.ts
      • e2e/react-start/basic-prerendering/src/routes/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/routeTree.gen.ts
      • e2e/react-start/basic-prerendering/src/routes/posts.index.tsx
      • e2e/react-start/basic-prerendering/src/router.tsx
      • e2e/react-start/basic-prerendering/src/routes/scripts.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/route.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx
      • e2e/react-start/basic-prerendering/playwright.config.ts
      • e2e/react-start/basic-prerendering/src/routes/users.tsx
      • e2e/react-start/basic-prerendering/src/routes/api.users.ts
      **/src/routes/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Place file-based routes under src/routes/ directories

      Files:

      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/inline-scripts.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/loader-throws-redirect.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/대한민국.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.$postId.tsx
      • e2e/react-start/basic-prerendering/src/routes/deferred.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout.tsx
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts_.$postId.deep.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/routes/__root.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts
      • e2e/react-start/basic-prerendering/src/routes/stream.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-useServerFn.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.index.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx
      • e2e/react-start/basic-prerendering/src/routes/links.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx
      • e2e/react-start/basic-prerendering/src/routes/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.index.tsx
      • e2e/react-start/basic-prerendering/src/routes/scripts.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/route.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.tsx
      • e2e/react-start/basic-prerendering/src/routes/api.users.ts
      e2e/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Store end-to-end tests under the e2e/ directory

      Files:

      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/index.tsx
      • e2e/react-start/basic-prerendering/start-dummy-server.mjs
      • e2e/react-start/basic-prerendering/src/routes/inline-scripts.tsx
      • e2e/react-start/basic-prerendering/src/client.tsx
      • e2e/react-start/basic-prerendering/src/server.ts
      • e2e/react-start/basic-prerendering/public/site.webmanifest
      • e2e/react-start/basic-prerendering/src/routes/search-params/loader-throws-redirect.tsx
      • e2e/react-start/basic-prerendering/stop-dummy-server.mjs
      • e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx
      • e2e/react-start/basic-prerendering/package.json
      • e2e/react-start/basic-prerendering/src/routes/redirect/index.tsx
      • e2e/react-start/basic-prerendering/tailwind.config.mjs
      • e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx
      • e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here/index.tsx
      • e2e/react-start/basic-prerendering/tests/setup/global.setup.ts
      • e2e/react-start/basic-prerendering/src/components/NotFound.tsx
      • e2e/react-start/basic-prerendering/public/script2.js
      • e2e/react-start/basic-prerendering/src/routes/대한민국.tsx
      • e2e/react-start/basic-prerendering/src/components/RedirectOnClick.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.tsx
      • e2e/react-start/basic-prerendering/src/utils/users.tsx
      • e2e/react-start/basic-prerendering/src/styles/app.css
      • e2e/react-start/basic-prerendering/src/components/CustomMessage.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts.$postId.tsx
      • e2e/react-start/basic-prerendering/src/routes/deferred.tsx
      • e2e/react-start/basic-prerendering/src/components/DefaultCatchBoundary.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout.tsx
      • e2e/react-start/basic-prerendering/src/utils/posts.tsx
      • e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here.tsx
      • e2e/react-start/basic-prerendering/src/routes/posts_.$postId.deep.tsx
      • e2e/react-start/basic-prerendering/server.js
      • e2e/react-start/basic-prerendering/tests/setup/global.teardown.ts
      • e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/components/throwRedirect.ts
      • e2e/react-start/basic-prerendering/src/routes/__root.tsx
      • e2e/react-start/basic-prerendering/postcss.config.mjs
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts
      • e2e/react-start/basic-prerendering/src/routes/stream.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-useServerFn.tsx
      • e2e/react-start/basic-prerendering/public/script.js
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-loader.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.index.tsx
      • e2e/react-start/basic-prerendering/tests/prerendering.spec.ts
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx
      • e2e/react-start/basic-prerendering/src/routes/links.tsx
      • e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx
      • e2e/react-start/basic-prerendering/vite.config.ts
      • e2e/react-start/basic-prerendering/tsconfig.json
      • e2e/react-start/basic-prerendering/src/utils/seo.ts
      • e2e/react-start/basic-prerendering/src/routes/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx
      • e2e/react-start/basic-prerendering/src/routeTree.gen.ts
      • e2e/react-start/basic-prerendering/src/routes/posts.index.tsx
      • e2e/react-start/basic-prerendering/src/router.tsx
      • e2e/react-start/basic-prerendering/src/routes/scripts.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/route.tsx
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target.tsx
      • e2e/react-start/basic-prerendering/src/routes/search-params/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx
      • e2e/react-start/basic-prerendering/playwright.config.ts
      • e2e/react-start/basic-prerendering/src/routes/users.tsx
      • e2e/react-start/basic-prerendering/src/routes/api.users.ts
      packages/{*-start,start-*}/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Name and place Start framework packages under packages/-start/ or packages/start-/

      Files:

      • packages/start-plugin-core/src/prerender.ts
      • packages/start-plugin-core/src/start-router-plugin/plugin.ts
      • packages/start-plugin-core/src/schema.ts
      **/package.json

      📄 CodeRabbit inference engine (AGENTS.md)

      Use workspace:* protocol for internal dependencies in package.json files

      Files:

      • e2e/react-start/basic-prerendering/package.json
      docs/**/*.{md,mdx}

      📄 CodeRabbit inference engine (AGENTS.md)

      Use internal docs links relative to the docs/ folder (e.g., ./guide/data-loading)

      Files:

      • docs/start/framework/react/guide/static-prerendering.md
      docs/{router,start}/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Place router docs under docs/router/ and start framework docs under docs/start/

      Files:

      • docs/start/framework/react/guide/static-prerendering.md
      🧠 Learnings (2)
      📚 Learning: 2025-09-23T17:36:12.598Z
      Learnt from: CR
      PR: TanStack/router#0
      File: AGENTS.md:0-0
      Timestamp: 2025-09-23T17:36:12.598Z
      Learning: Applies to **/*.{ts,tsx} : Use TypeScript in strict mode with extensive type safety across the codebase

      Applied to files:

      • e2e/react-start/basic-prerendering/tsconfig.json
      📚 Learning: 2025-10-01T18:31:35.420Z
      Learnt from: schiller-manuel
      PR: TanStack/router#5330
      File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
      Timestamp: 2025-10-01T18:31:35.420Z
      Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.

      Applied to files:

      • e2e/react-start/basic-prerendering/src/routeTree.gen.ts
      🧬 Code graph analysis (48)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-beforeLoad.tsx (1)
      e2e/react-start/basic-prerendering/src/components/throwRedirect.ts (1)
      • throwRedirect (4-23)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/index.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic/src/routes/redirect/$target/index.tsx (1)
      • preload (4-75)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/_layout.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/index.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/start-dummy-server.mjs (1)
      scripts/set-ts-version.js (1)
      • packageJson (33-33)
      e2e/react-start/basic-prerendering/src/routes/inline-scripts.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/__root.tsx (1)
      • Route (16-75)
      packages/router-core/src/ssr/tsrScript.ts (1)
      • p (7-9)
      packages/start-plugin-core/src/prerender.ts (1)
      packages/router-generator/src/generator.ts (1)
      • getCrawlingResult (1183-1186)
      e2e/react-start/basic-prerendering/src/routes/search-params/loader-throws-redirect.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/stop-dummy-server.mjs (1)
      scripts/set-ts-version.js (1)
      • packageJson (33-33)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/redirect/index.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here/index.tsx (1)
      e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/tests/setup/global.setup.ts (1)
      scripts/set-ts-version.js (1)
      • packageJson (33-33)
      e2e/react-start/basic-prerendering/src/components/NotFound.tsx (6)
      e2e/react-start/basic-cloudflare/src/components/NotFound.tsx (1)
      • NotFound (3-25)
      e2e/react-start/server-routes/src/components/NotFound.tsx (1)
      • NotFound (3-25)
      examples/react/start-basic-cloudflare/src/components/NotFound.tsx (1)
      • NotFound (3-25)
      examples/react/start-basic-cloudflare/src/routes/__root.tsx (1)
      • NotFound (61-61)
      e2e/react-start/basic-cloudflare/src/routes/__root.tsx (1)
      • NotFound (55-55)
      examples/react/start-basic-cloudflare/src/router.tsx (1)
      • NotFound (11-11)
      e2e/react-start/basic-prerendering/src/routes/대한민국.tsx (1)
      e2e/react-router/basic-file-based/src/routes/대한민국.tsx (1)
      • RouteComponent (7-9)
      e2e/react-start/basic-prerendering/src/components/RedirectOnClick.tsx (1)
      e2e/react-start/basic-prerendering/src/components/throwRedirect.ts (1)
      • throwRedirect (4-23)
      e2e/react-start/basic-prerendering/src/routes/posts.tsx (1)
      e2e/react-start/basic-prerendering/src/utils/posts.tsx (1)
      • fetchPosts (35-42)
      e2e/react-start/basic-prerendering/src/routes/posts.$postId.tsx (2)
      e2e/react-start/basic-prerendering/src/utils/posts.tsx (1)
      • fetchPost (17-33)
      e2e/react-start/basic-prerendering/src/components/NotFound.tsx (1)
      • NotFound (3-25)
      e2e/react-start/basic-prerendering/src/routes/deferred.tsx (2)
      examples/solid/start-basic/src/routes/deferred.tsx (1)
      • Deferred (31-62)
      e2e/react-start/basic/src/routes/deferred.tsx (1)
      • deferredStuff (19-27)
      e2e/react-start/basic-prerendering/src/components/DefaultCatchBoundary.tsx (1)
      e2e/react-start/server-routes/src/components/DefaultCatchBoundary.tsx (1)
      • DefaultCatchBoundary (10-53)
      e2e/react-start/basic-prerendering/src/routes/_layout.tsx (2)
      e2e/react-router/basic-esbuild-file-based/src/routes/_layout.tsx (1)
      • LayoutComponent (7-16)
      e2e/react-router/basic-file-based-code-splitting/src/routes/_layout.tsx (1)
      • LayoutComponent (7-16)
      e2e/react-start/basic-prerendering/src/utils/posts.tsx (1)
      e2e/react-router/js-only-file-based/src/posts.js (1)
      • queryURL (5-5)
      e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here.tsx (1)
      e2e/react-start/basic-prerendering/src/routes/foo/$bar/$qux/_here/index.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/posts_.$postId.deep.tsx (1)
      e2e/react-start/basic-prerendering/src/utils/posts.tsx (1)
      • fetchPost (17-33)
      e2e/react-start/basic-prerendering/tests/setup/global.teardown.ts (2)
      e2e/solid-router/basic-file-based/tests/setup/global.teardown.ts (1)
      • teardown (4-6)
      e2e/solid-router/basic-virtual-file-based/tests/setup/global.teardown.ts (1)
      • teardown (4-6)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-loader.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/__root.tsx (1)
      e2e/react-start/server-routes/src/routes/__root.tsx (1)
      • RootDocument (57-82)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts (3)
      e2e/react-router/js-only-file-based/src/posts.js (1)
      • queryURL (5-5)
      e2e/react-start/basic-prerendering/src/routes/api.users.ts (1)
      • Route (13-28)
      e2e/react-start/basic-prerendering/src/utils/users.tsx (1)
      • User (1-5)
      e2e/react-start/basic-prerendering/src/routes/stream.tsx (1)
      e2e/react-start/basic/src/routes/stream.tsx (1)
      • Home (26-64)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/via-useServerFn.tsx (1)
      e2e/react-start/basic-prerendering/src/components/RedirectOnClick.tsx (1)
      • RedirectOnClick (10-26)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx (4)
      e2e/react-start/basic-prerendering/src/routes/__root.tsx (1)
      • Route (16-75)
      e2e/react-start/basic-prerendering/src/routes/_layout.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-b.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/_layout.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/src/routes/_layout/_layout-2/layout-a.tsx (1)
      • Route (3-5)
      e2e/react-start/basic-prerendering/vite.config.ts (1)
      packages/router-core/src/ssr/tsrScript.ts (1)
      • p (7-9)
      e2e/react-start/basic-prerendering/src/routes/index.tsx (1)
      e2e/react-start/basic-prerendering/src/components/CustomMessage.tsx (1)
      • CustomMessage (3-10)
      e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/not-found/index.tsx (1)
      • Route (3-31)
      e2e/react-start/basic-prerendering/src/routeTree.gen.ts (2)
      e2e/react-router/js-only-file-based/src/routeTree.gen.js (4)
      • IndexRoute (30-34)
      • PostsIndexRoute (35-39)
      • PostsPostIdRoute (40-44)
      • rootRouteChildren (90-94)
      e2e/react-start/basic-prerendering/src/router.tsx (1)
      • getRouter (6-16)
      e2e/react-start/basic-prerendering/src/routes/posts.index.tsx (1)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/router.tsx (2)
      e2e/react-start/basic-prerendering/src/components/DefaultCatchBoundary.tsx (1)
      • DefaultCatchBoundary (10-53)
      e2e/react-start/basic-prerendering/src/components/NotFound.tsx (1)
      • NotFound (3-25)
      e2e/react-start/basic-prerendering/src/routes/scripts.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/__root.tsx (1)
      • Route (16-75)
      e2e/react-start/basic-prerendering/src/routes/inline-scripts.tsx (1)
      • Route (3-18)
      e2e/react-start/basic-prerendering/src/routes/search-params/route.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/not-found/route.tsx (1)
      • Route (4-8)
      e2e/react-start/basic-prerendering/src/routes/not-found/via-beforeLoad.tsx (1)
      • Route (3-15)
      e2e/react-start/basic-prerendering/src/routes/search-params/index.tsx (2)
      e2e/react-start/basic-prerendering/src/routes/index.tsx (1)
      • Route (4-6)
      e2e/react-start/basic-prerendering/src/routes/links.tsx (1)
      • Route (3-47)
      e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx (4)
      e2e/react-start/basic-prerendering/src/routes/api.users.ts (1)
      • Route (13-28)
      e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts (1)
      • Route (12-32)
      e2e/react-start/basic-prerendering/src/utils/users.tsx (1)
      • User (1-5)
      e2e/react-start/basic-prerendering/src/components/NotFound.tsx (1)
      • NotFound (3-25)
      e2e/react-start/basic-prerendering/playwright.config.ts (1)
      scripts/set-ts-version.js (1)
      • packageJson (33-33)
      e2e/react-start/basic-prerendering/src/routes/users.tsx (3)
      e2e/react-start/basic-prerendering/src/routes/api.users.ts (1)
      • Route (13-28)
      e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts (1)
      • Route (12-32)
      e2e/react-start/basic-prerendering/src/utils/users.tsx (1)
      • User (1-5)
      e2e/react-start/basic-prerendering/src/routes/api.users.ts (2)
      e2e/react-start/basic-prerendering/src/routes/api/users.$id.ts (1)
      • Route (12-32)
      e2e/react-start/basic-prerendering/src/utils/users.tsx (1)
      • User (1-5)
      🪛 Biome (2.1.2)
      e2e/react-start/basic-prerendering/src/routes/deferred.tsx

      [error] 43-43: Avoid passing children using a prop

      The canonical way to pass children in React is to use JSX elements

      (lint/correctness/noChildrenProp)


      [error] 53-53: Avoid passing children using a prop

      The canonical way to pass children in React is to use JSX elements

      (lint/correctness/noChildrenProp)

      e2e/react-start/basic-prerendering/src/routes/stream.tsx

      [error] 51-51: Avoid passing children using a prop

      The canonical way to pass children in React is to use JSX elements

      (lint/correctness/noChildrenProp)

      🪛 LanguageTool
      docs/start/framework/react/guide/static-prerendering.md

      [grammar] ~12-~12: There might be a mistake here. Context: ... parameters (e.g., /about, /contact) - Routes with search parameters that have ...

      (QB_NEW_EN)


      [grammar] ~13-~13: There might be a mistake here. Context: ...arch parameters that have default values - Routes that don't require dynamic data f...

      (QB_NEW_EN)

      ⏰ 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
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
      OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
    7. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/package.json lines 17 to 19

      this is copied from the basic e2e test

    8. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/playwright.config.ts line 12

      this is copied from the basic e2e test

    9. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/server.js lines 32 to 46

      this is copied from the basic e2e test

    10. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/links.tsx line 8

      this is copied from the basic e2e test

    11. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx lines 8 to 13

      this is copied from the basic e2e test

    12. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/package.json lines 17 to 19
      🧩 Analysis chain

      🏁 Script executed:

      #!/bin/bash
      # Find all e2e package.json files and check their workspace dependency patterns
      echo "=== Checking workspace dependency patterns in e2e tests ==="
      fd -t f "package.json" e2e/ --exec grep -H "workspace:" {} \; 2>/dev/null || true
      
      echo -e "\n=== Specifically checking basic e2e test ==="
      fd -t f "package.json" e2e/react-start/basic --exec cat {} \; 2>/dev/null || true

      Length of output: 23416


      @FatahChan, you're absolutely right! I can confirm that all e2e test packages in the repository (50+ files across both React and Solid projects) consistently use workspace:^ for internal TanStack dependencies, including the basic e2e test you mentioned.

      This creates a conflict with the learning I have on record that suggests using workspace:*. Given the overwhelming consistency across the entire e2e directory, it appears that either:

      1. The learning doesn't apply to e2e test packages, OR
      2. There's a repository-wide pattern that needs updating

      Since you correctly followed the established e2e convention, I shouldn't flag this. Would you like me to:

      • Update the learning to exclude e2e tests from the workspace:* requirement?
      • OR clarify if there's an intention to update all e2e packages to use workspace:* (which would be a significant change)?

      Let me know your preference, and I'll adjust accordingly!


      🧠 Learnings used
      Learnt from: CR
      PR: TanStack/router#0
      File: AGENTS.md:0-0
      Timestamp: 2025-09-23T17:36:12.598Z
      Learning: Applies to **/package.json : Use workspace:* protocol for internal dependencies in package.json files
    13. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx lines 8 to 17

      this is copied from the basic e2e test

    14. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/stream.tsx lines 30 to 45

      this is copied from the basic e2e test

    15. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx lines 9 to 21

      this is copied from the basic e2e test

    16. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/links.tsx line 8

      @FatahChan, thanks for the context! Since this typo exists in both the original basic e2e test and this copy, it would be ideal to fix it in both places so the invalid Tailwind class (lmd:text-5xl) doesn't persist. The corrected md:text-5xl breakpoint will ensure the responsive styling works as intended.

      Would you like to update both, or would you prefer to fix just this instance for now?

    17. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/utils/seo.ts lines 12 to 30

      this is copied from the basic e2e test

    18. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/playwright.config.ts line 12
      🧩 Analysis chain

      🏁 Script executed:

      #!/bin/bash
      # Search for similar ssrModeCommand patterns in other e2e test configurations
      echo "=== Searching for ssrModeCommand patterns in e2e test configs ==="
      rg -n "ssrModeCommand" --type=ts -C 3
      
      echo -e "\n=== Searching for playwright.config files in e2e directories ==="
      fd -e ts -e js "playwright.config" e2e/
      
      echo -e "\n=== Looking for stopDummyServer usage in e2e configs ==="
      rg -n "stopDummyServer" --type=ts --type=js e2e/

      Length of output: 6773


      🏁 Script executed:

      #!/bin/bash
      # Let's look at the react-start/basic playwright config in detail
      echo "=== Content of react-start/basic/playwright.config.ts ==="
      cat e2e/react-start/basic/playwright.config.ts
      
      echo -e "\n=== Checking for dummy server usage in react-start/basic ==="
      rg -n "dummy" e2e/react-start/basic/ --type=ts --type=json
      
      echo -e "\n=== Checking package.json scripts in basic-prerendering ==="
      cat e2e/react-start/basic-prerendering/package.json | jq '.scripts'
      
      echo -e "\n=== Checking package.json scripts in basic ==="
      cat e2e/react-start/basic/package.json | jq '.scripts'

      Length of output: 2725


      🏁 Script executed:

      #!/bin/bash
      echo "=== basic-prerendering global.setup.ts ==="
      cat e2e/react-start/basic-prerendering/tests/setup/global.setup.ts
      
      echo -e "\n=== basic-prerendering global.teardown.ts ==="
      cat e2e/react-start/basic-prerendering/tests/setup/global.teardown.ts
      
      echo -e "\n=== basic global.setup.ts ==="
      cat e2e/react-start/basic/tests/setup/global.setup.ts
      
      echo -e "\n=== basic global.teardown.ts ==="
      cat e2e/react-start/basic/tests/setup/global.teardown.ts

      Length of output: 1040


      @FatahChan, I checked the react-start/basic test configuration, and it actually uses a simpler pattern:

      const ssrModeCommand = `pnpm build && pnpm start`

      The basic test relies on globalSetup to start the dummy server and globalTeardown to stop it. It doesn't start or stop the dummy server within ssrModeCommand.

      Your current configuration has a lifecycle conflict:

      1. globalSetup starts the dummy server
      2. ssrModeCommand starts it again (?), builds, stops it, then starts the app
      3. Tests run (but the dummy server is now stopped, so API calls fail)
      4. globalTeardown tries to stop an already-stopped server

      Since you already have globalSetup and globalTeardown handling the dummy server lifecycle (just like the basic test), you should align with the basic pattern:

      -const ssrModeCommand = `pnpm test:e2e:dummyServer && pnpm build && pnpm test:e2e:stopDummyServer && pnpm start`
      +const ssrModeCommand = `pnpm build && pnpm start`

      This way:

      • globalSetup starts the dummy server once
      • ssrModeCommand just builds and starts the app (dummy server is already running)
      • Tests run with the dummy server available
      • globalTeardown cleans up the dummy server

      This matches the pattern used in react-start/basic and ensures the dummy server stays alive for your API/prerendering tests.

    19. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx lines 8 to 13

      @FatahChan, understood! Since the parent route already validates target via zod to only accept 'internal' or 'external', the switch statement will never receive an unexpected value in normal operation. The missing default case is fine for test code that's consistent with existing patterns.


      ✏️ Learnings added
      Learnt from: FatahChan
      PR: TanStack/router#5475
      File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0
      Timestamp: 2025-10-14T18:59:33.970Z
      Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.

      Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

    20. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx lines 8 to 17

      @FatahChan, understood! Since this is mirroring the basic e2e test structure, keeping it consistent makes sense. No changes needed.

    21. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/stream.tsx lines 30 to 45

      @FatahChan, understood! Since this code is consistent with the existing basic e2e test patterns, I'll defer to that precedent. If any issues arise in the future, the cleanup and error handling can be addressed across all similar test cases.

    22. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx lines 9 to 21
      🧩 Analysis chain

      🏁 Script executed:

      #!/bin/bash
      # Check if basic e2e test has similar error handling pattern in users.$userId.tsx
      fd -t f "users.\\\$userId.tsx" e2e/react-start/basic -x cat {}

      Length of output: 1037


      @FatahChan, understood! I can confirm the basic e2e test has the identical pattern. If you'd like to keep both test suites aligned, that makes sense. If you ever decide to address the unreachable notFoundComponent in the future, the same fix would apply to both files.

    23. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/utils/seo.ts lines 12 to 30

      @FatahChan, understood! Since this code is copied from the existing basic e2e test, you can certainly keep it as-is to maintain consistency with the source. If you'd like to address the potential undefined content issue in a follow-up PR for both locations, that's an option too—but no need to block this PR on it.

      Feel free to resolve this comment when you're ready! 👍

    24. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/package.json line 10

      this is copied from the basic e2e test

    25. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/server.js lines 32 to 38

      this is copied from the basic e2e test

    26. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/api.users.ts lines 15 to 22

      this is copied from the basic e2e test

    27. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx lines 8 to 17

      this is copied from the basic e2e test

    28. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/api.users.ts lines 15 to 22

      @FatahChan, understood! Since this follows the existing patterns in your basic e2e test suite, the current implementation is consistent with your testing approach. Thank you for the clarification.

    29. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/utils/seo.ts lines 1 to 33

      this is copied from the basic e2e test

    30. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/package.json line 10
      🧩 Analysis chain

      🏁 Script executed:

      #!/bin/bash
      # Search for similar start script patterns in other e2e tests
      echo "=== Checking other e2e test package.json files for start script patterns ==="
      fd -t f "package.json" e2e/react-start --exec sh -c 'echo "File: {}" && grep -A 1 "\"start\":" {} || true'
      
      echo -e "\n=== Looking for basic e2e test specifically ==="
      fd -d 2 -t d "basic" e2e/react-start
      
      echo -e "\n=== Checking if basic e2e test exists and its start script ==="
      if [ -f "e2e/react-start/basic/package.json" ]; then
        echo "Found basic e2e test package.json"
        cat e2e/react-start/basic/package.json | grep -A 2 "\"start\":"
      else
        echo "basic e2e test not found in expected location"
      fi

      Length of output: 3385


      @FatahChan, you're absolutely right! I verified the pattern across the e2e tests and confirmed that ../client is indeed the standard approach used consistently throughout the repository:

      • basic e2e test: "start": "pnpx srvx --prod -s ../client dist/server/server.js"
      • 10+ other e2e tests use the identical pattern

      The ../client path works correctly because when srvx executes dist/server/server.js, the relative path ../client properly resolves to dist/client. My initial concern was incorrect—this is the established convention for e2e tests in this repository.

      No changes are needed here. Thank you for the clarification! 🐰

    31. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/styles/app.css lines 27 to 29

      this is copied from the basic e2e test

    32. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/users.tsx lines 32 to 35

      this is copied from the basic e2e test

    33. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx lines 1 to 22

      this is copied from the basic e2e test

    34. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/search-params/default.tsx lines 8 to 17

      @FatahChan, understood! Since this pattern is copied from the existing basic e2e test, it makes sense to maintain consistency. The duplication in both lifecycle hooks is likely intentional for testing purposes. Thanks for clarifying! 👍


      🧠 Learnings used
      Learnt from: FatahChan
      PR: TanStack/router#5475
      File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0
      Timestamp: 2025-10-14T18:59:33.970Z
      Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.
    35. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/server.js lines 32 to 38
      🧩 Analysis chain

      🏁 Script executed:

      #!/bin/bash
      # Find server.js files in e2e directories that might be the "basic" test mentioned
      fd -t f "server.js" e2e/
      
      # Search for similar proxy configuration patterns in the codebase
      rg -nP -A5 -B2 "createProxyMiddleware.*'/api'" --type js --type ts

      Length of output: 108


      🏁 Script executed:

      #!/bin/bash
      # Check the basic e2e test server.js to see if it has the same proxy config issue
      cat e2e/react-start/basic/server.js

      Length of output: 1608


      @FatahChan, thank you for the context! I can see that e2e/react-start/basic/server.js has the same proxy configuration pattern. The issue exists in both locations:

      In the source file (e2e/react-start/basic/server.js):

      • Lines 32-37: /api proxy with duplicated path and changeOrigin: false
      • Lines 39-44: /_serverFn proxy with the same issue

      In this PR's new file (e2e/react-start/basic-prerendering/server.js):

      • Lines 32-37: /api proxy with the same issue

      The problem is that http-proxy-middleware automatically appends the incoming request path to the target URL. So with target: 'http://localhost:${startPort}/api', a request to /api/users becomes /api/api/users.

      Would you like to fix both locations? The correct configuration should be:

      createProxyMiddleware({
        target: `http://localhost:${startPort}`,
        changeOrigin: true,
      })

      This ensures:

      1. No path duplication (request to /api/users goes to http://localhost:3001/api/users)
      2. Proper handling of virtual hosted sites with changeOrigin: true
    36. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx lines 8 to 14

      this is copied from the basic e2e test

    37. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx lines 8 to 13

      this is copied from the basic e2e test

    38. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/styles/app.css lines 27 to 29

      @FatahChan, understood! Since this CSS is copied from the existing basic e2e test, I'll skip this concern for now. If the input method detection is already handled (or intentionally omitted) in that test, this is consistent with that approach.

    39. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/links.tsx lines 8 to 10

      this is copied from the basic e2e test

    40. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/server.js lines 40 to 46

      this is copied from the basic e2e test

    41. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/users.tsx lines 32 to 35

      @FatahChan, you're absolutely right! I apologize for the incorrect suggestion.

      Looking at the PR changes, the route file is indeed src/routes/users.$userId.tsx (not users.$id.tsx as I incorrectly assumed), so the Link component is correctly using:

      • to="/users/$userId"
      • params={{ userId: String(user.id) }}

      This matches the route definition perfectly. The code is correct as-is. Thank you for the clarification!

    42. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/utils/users.tsx line 7

      this is copied from the basic e2e test

    43. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx lines 8 to 13

      @FatahChan, understood! Since this is test code copied from the existing basic e2e test suite, the pattern is intentional and consistent with your testing strategy. I'll leave this as-is. Thank you for the clarification! 👍

    44. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-loader.tsx lines 8 to 14

      @FatahChan, thank you for the clarification! Since this is copied from the existing basic e2e test to maintain consistency with the established test patterns, that makes sense. I'll defer to the existing test structure. 👍


      🧠 Learnings used
      Learnt from: schiller-manuel
      PR: TanStack/router#5330
      File: packages/router-core/src/router.ts:2231-2245
      Timestamp: 2025-10-01T18:30:26.591Z
      Learning: In `packages/router-core/src/router.ts`, the `resolveRedirect` method intentionally strips the router's origin from redirect URLs when they match (e.g., `https://foo.com/bar` → `/bar` for same-origin redirects) while preserving the full URL for cross-origin redirects. This logic should not be removed or simplified to use `location.publicHref` directly.
    45. FatahChan(GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/utils/posts.tsx lines 21 to 30

      this is copied from the basic e2e test

    46. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/utils/seo.ts lines 1 to 33

      @FatahChan, understood! Since this code is copied from the existing basic e2e test to maintain consistency, it makes sense to keep it as-is. If the undefined values issue needs addressing, it can be handled in the original test file rather than making this instance diverge. Thanks for the clarification! 🐰

    47. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/users.$userId.tsx lines 1 to 22

      @FatahChan, understood! Since this is copied from the basic e2e test for consistency, I won't push for the change here. If you'd like to improve the error handling to make the notFoundComponent reachable in both tests, the same pattern could be applied to the source test as well, but I'll leave that decision to you. Thanks for the context!

    48. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/routes/links.tsx lines 8 to 10
      🧩 Analysis chain

      🏁 Script executed:

      #!/bin/bash
      # Search for the 'lmd:' typo in the codebase
      echo "=== Searching for 'lmd:' typo in the codebase ==="
      rg -n 'lmd:' --type=tsx --type=ts --type=jsx --type=js
      
      echo ""
      echo "=== Searching more broadly for this typo ==="
      rg -n 'lmd:text-5xl'
      
      echo ""
      echo "=== Looking for the basic e2e test file ==="
      fd -t f links.tsx e2e/

      Length of output: 1150


      @FatahChan, you're correct! The typo exists in the original e2e/react-start/basic/src/routes/links.tsx file. I found this same typo in 6 files across the codebase:

      React Start tests:

      • e2e/react-start/basic/src/routes/links.tsx (original)
      • e2e/react-start/basic/src/routes/redirect/$target/serverFn/index.tsx
      • e2e/react-start/basic-prerendering/src/routes/links.tsx (current file)
      • e2e/react-start/basic-prerendering/src/routes/redirect/$target/serverFn/index.tsx

      Solid Start tests:

      • e2e/solid-start/basic/src/routes/links.tsx
      • e2e/solid-start/basic/src/routes/redirect/$target/serverFn/index.tsx

      Since this is test code and you're aware of it, you can choose to fix all occurrences in a follow-up PR if you'd like. Would you like me to create an issue to track fixing this typo across all test files?

    49. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/server.js lines 32 to 46

      @FatahChan, understood! Since this is test infrastructure copied from the basic e2e setup, the configuration is likely fine as-is.

      For localhost-to-localhost proxying in tests, changeOrigin: false is actually appropriate because you're not dealing with virtual hosted sites—both the proxy and target are on the same machine. However, the comment "Needed for virtual hosted sites" is misleading in this context.

      Consider updating the comments to be more accurate:

      app.use(
        '/api',
        createProxyMiddleware({
          target: `http://localhost:${startPort}/api`,
          changeOrigin: false, // Keep original Host header (both are localhost)
        }),
      )
      
      app.use(
        '/_serverFn',
        createProxyMiddleware({
          target: `http://localhost:${startPort}/_serverFn`,
          changeOrigin: false, // Keep original Host header (both are localhost)
        }),
      )

      This is a minor documentation clarity issue rather than a functional bug, so feel free to address it when convenient or leave it if it's consistent with the basic e2e test setup.

    50. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/server.js lines 40 to 46
      🧩 Analysis chain

      🏁 Script executed:

      #!/bin/bash
      # Search for other server.js files in e2e tests
      fd -e js server.js e2e/
      
      # Search for createProxyMiddleware usage in e2e tests
      rg -n "createProxyMiddleware" e2e/ -A5 -B2

      Length of output: 4914


      @FatahChan, thanks for the context! I can see that this proxy configuration is indeed copied from e2e/react-start/basic/server.js and the same pattern also exists in e2e/solid-start/basic/server.js. All three files use the same approach with the path duplicated in the target and changeOrigin: false.

      If these configurations are working correctly in the existing tests, then it's likely fine here too. However, if there is a genuine issue with the proxy setup, it would be worth addressing it consistently across all the e2e test files rather than just this one.

      Since this follows the established pattern in your e2e tests, I'll defer to your judgment on whether any changes are needed! 👍

    51. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/utils/posts.tsx lines 21 to 30

      @FatahChan, understood—thanks for the context! If the original basic e2e test uses this pattern, I'll defer to maintaining consistency for now. If you'd like to fix the error handling in both places later (using error.response.status for more reliable 404 detection with redaxios), feel free, but I won't press the issue here. 👍

    52. coderabbitai[bot](GitHub profile, opens in a new tab)replied on e2e/react-start/basic-prerendering/src/utils/users.tsx line 7
      🧩 Analysis chain

      🏁 Script executed:

      #!/bin/bash
      # Search for similar process.env usage patterns in e2e tests
      echo "=== Searching for process.env.VITE_SERVER_PORT in e2e directories ==="
      rg -n --type=ts --type=tsx -C3 'process\.env\.VITE_SERVER_PORT' e2e/
      
      echo -e "\n=== Searching for 'basic' e2e test directories ==="
      fd -t d 'basic' e2e/
      
      echo -e "\n=== Checking users.tsx files in e2e directories ==="
      fd 'users\.tsx' e2e/ --exec cat {}

      Length of output: 11303


      🏁 Script executed:

      #!/bin/bash
      # Check where DEPLOY_URL is used in this e2e test
      echo "=== Usage of DEPLOY_URL in basic-prerendering ==="
      rg -n 'DEPLOY_URL' e2e/react-start/basic-prerendering/
      
      echo -e "\n=== Checking if this runs server-side or client-side ==="
      echo "Looking at api.users.ts to see runtime context:"
      cat e2e/react-start/basic-prerendering/src/routes/api.users.ts
      
      echo -e "\n=== Comparing with basic e2e test pattern ==="
      cat e2e/react-start/basic/src/utils/users.tsx

      Length of output: 1252


      @FatahChan, thanks for the clarification! You're right—I can see the basic e2e test has the exact same pattern.

      Looking at the usage, DEPLOY_URL is exported but never actually used in this test suite. The API routes in api.users.ts use import.meta.env.VITE_EXTERNAL_PORT directly instead.

      Since this is dead code, a simpler approach would be to remove the unused export entirely:

       export type User = {
         id: number
         name: string
         email: string
       }
      -
      -const PORT = process.env.VITE_SERVER_PORT || 3000
      -
      -export const DEPLOY_URL = `http://localhost:${PORT}`

      However, if you're keeping it for consistency with the basic test or potential future use, then leaving it as-is is fine—it won't cause issues since it's not being consumed anywhere. Your call!

    53. OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
    54. OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
    55. i dont think we need a separate e2e test for this, can we please just add this to the existing start-basic e2e test?

    56. FatahChan(GitHub profile, opens in a new tab)replied on packages/start-plugin-core/src/start-router-plugin/plugin.ts line 151

      because of the generator, when I create a Generator inside of the prerender() The config for the generator is not the same as in the build step here , so when i call generator.run() a different routeTree.gen.ts is generated, which leads to type error

    57. i dont think we need a separate e2e test for this, can we please just add this to the existing start-basic e2e test?

      I will check, but i didn't want to change the existing testing by turning on prerender, I might be able to create a different command to build for prerender, so test dont conflict.

      WDYT?

    58. FatahChan(GitHub profile, opens in a new tab)replied on packages/start-plugin-core/src/prerender.ts line 28

      I am not sure, I am following, sorry a bit new to creating vite plugin, can you elaborate more

    59. OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
    60. packages/start-plugin-core/src/prerender.ts line 313Outdated
      @@ -260,3 +300,14 @@
      260300 await fsp.writeFile(fullPath, content)
      261301 }
      262302 }
      303+
      304+function getPrerenderablePaths(
      305+ routeNodes: Array<RouteNode>,
      306+): Array<{ path: string }> {
      307+ const paths = new Set<string>(['/'])
      308+
      309+ for (const route of routeNodes) {
      310+ if (!route.routePath) continue
      311+
      312+ // filter routes that are layout
      313+ if (route.isNonPath === true) continue

      wouldnt we just want to render leaf routes?

      not sure I understand, but this code just check that it's not a layout, and nodes that doesn't have routePath

      what are leaf routes? do they not have routePath?

      if a route does not have children it's a leaf

      yeah, so you I should just check if the route has children?

      how would it work for

      users.tsx users/details.tsx

      user.tsx has children and a leaf node at the same time right?

      yeah, after testing. we still need to render non leaf children, i.e routes that have

      let me know if you have other conrences regarding this point, otherwise, please resolve this conversation

      what are "non leaf children"?

      in your example

      users.tsx << non leaf
      users/index.tsx << leaf
      users/details.tsx << leaf
    61. FatahChan(GitHub profile, opens in a new tab)replied on packages/start-plugin-core/src/prerender.ts line 28

      I asked claude, I think I understand, maybe

    62. OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
    63. OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
    64. OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
    65. OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)
    66. OutdatedResolvedby FatahChan(GitHub profile, opens in a new tab)

Sign in to join this conversation.