Setu-TS
    Preparing search index...

    Function loadRequestHandler

    • Default implementation of loadRequestHandler.

      Lazily imports the app-provided server build (import(serverBuildPath)) and the core react-router package (import(react-router)), unwraps the ServerBuild (default export), then returns a callable request handler.

      Both the handler and the context-provider factory come from the SAME module object, so the provider instance can never be tested against a different copy of the RouterContextProvider class than the one it was constructed from.

      Parameters

      • serverBuildPath: string

        Path to the RR Vite server build (app-provided)

      • mode: string

        'production' or 'development'

      • Optionaloptions: { rrImportHook?: () => Promise<Record<string, unknown>>; serverBuild?: unknown }

        Optional override for the react-router import seam

        • OptionalrrImportHook?: () => Promise<Record<string, unknown>>
        • OptionalserverBuild?: unknown

          The app's compiled server build, supplied as a module (M113d §3.10). When present the path import is skipped entirely — the form a bundled Cloudflare Worker uses, where no path can be resolved at runtime.

      Returns Promise<SsrRuntime>

      A promise resolving to the handler and its context factory

      When either import fails, with a message naming the missing specifier

      0.1.0