Svelte Kit Server Export Unavailable Error
Trace execution of SER's publish-time fallback for a SvelteKit virtual server export.What this error means and what can trigger it
SvelteKitServerExportUnavailableError means code executed SER's internal publish-time shim for $app/server instead of the virtual module implementation supplied by SvelteKit. The class records the unavailable export in export_name.
The shim contains placeholders for query, command, form, prerender, and getRequestEvent, each of which throws immediately. This file is an internal build fallback rather than a supported public package entry, so application code should not import it directly.
Exactly where it triggers
All five placeholders construct through:
function make_sveltekit_server_error(name: string): Error {
return new SvelteKitServerExportUnavailableError(name);
}They throw from these exact placeholders:
modules/svelte-effect-runtime/src/internal/sveltekit-server.ts L11 @ C2forquery.modules/svelte-effect-runtime/src/internal/sveltekit-server.ts L22 @ C2forcommand.modules/svelte-effect-runtime/src/internal/sveltekit-server.ts L33 @ C2forform.modules/svelte-effect-runtime/src/internal/sveltekit-server.ts L44 @ C2forprerender.modules/svelte-effect-runtime/src/internal/sveltekit-server.ts L54 @ C2forgetRequestEvent.
For reference, the class itself is declared at modules/svelte-effect-runtime/src/errors.ts L786 @ C14.
Why this is the case
SvelteKit's compilation environment provides $app/server; plain Node execution cannot load it as an ordinary file. SER still needs a publish-time module shape to build the package, although that fallback cannot implement route-bound remote helpers or request lookup.
Failing immediately by name prevents the shim from behaving like a partial server implementation. The recorded export identifies which virtual capability was requested outside the environment that owns it.