function assertSsrRuntime
Since 0.2.0
assertSsrRuntime(value: unknown): SsrRuntime

Validates that an injected loadRequestHandler resolved to a usable SsrRuntime, and narrows it.

Without this check a seam returning the pre-0.2.0 bare handler registers cleanly, reports a healthy indicator, and then fails EVERY request with an opaque 500 when the missing createLoadContext is invoked per request — the same silent-500 class of defect this contract exists to remove. Failing during register() turns that into one actionable startup error.

Parameters

value: unknown

Whatever the seam resolved to

Return Type

The value narrowed to an SsrRuntime

Throws

Error

When handler or createLoadContext is not a function

Usage

import { assertSsrRuntime } from "react-router-plugin/src/index.ts";