sveltejs/kit · error · Error

${resolved_instrumentation} is unsupported in ${svelte_confi

Error message

${resolved_instrumentation} is unsupported in ${svelte_config.adapter.name}.

What it means

`src/instrumentation.server.ts` (server-side instrumentation entry) requires an adapter that declares support for it via `supports.instrumentation()`. If an `instrumentation.server` file exists but the configured adapter doesn't support it, dev startup throws this error naming the file and adapter.

Source

Thrown at packages/kit/src/exports/vite/dev/index.js:369

						});
						res.end(`import '${svelte_config.paths.base}${to_fs(resolved)}';`);
					} else {
						res.writeHead(404);
						res.end('not found');
					}

					return;
				}

				// resolve the instrumentation file per request so that changes to it
				// are picked up on new requests
				const resolved_instrumentation = resolve_entry(
					path.join(svelte_config.files.src, 'instrumentation.server')
				);

				if (resolved_instrumentation) {
					if (svelte_config.adapter && !svelte_config.adapter.supports?.instrumentation?.()) {
						throw new Error(
							`${resolved_instrumentation} is unsupported in ${svelte_config.adapter.name}.`
						);
					}

					const { set_env } = await runner.import('<sveltekit:generated>/env/config.js');
					set_env(env);
					await runner.import(resolved_instrumentation);
				}

				// we have to import `Server` before calling `set_assets`
				const { Server } = /** @type {ServerModule} */ (
					await runner.import(`${get_runtime_base(root)}/server/index.js`)
				);

				const { set_fix_stack_trace, format_response } = await runner.import(
					`${get_runtime_base(root)}/server/internal.js`
				);
				set_fix_stack_trace(fix_stack_trace);

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Upgrade the adapter to a version that supports instrumentation
  2. Remove or rename `src/instrumentation.server.*` if not needed
  3. Switch to an adapter that supports instrumentation (e.g. adapter-node)
  4. Implement initialization directly in `hooks.server.ts` instead of instrumentation

Example fix

// before
// src/instrumentation.server.ts  + adapter that lacks instrumentation support
// after
// move tracing setup into src/hooks.server.ts (or upgrade adapter-node)
export async function handle({ event, resolve }) {
  await initTracing();
  return resolve(event);
}
Defensive patterns

Strategy: validation

Validate before calling

// before adding src/instrumentation.server.ts, check adapter support:
if (adapter.supports && !adapter.supports.instrumentation?.()) {
  throw new Error(`${adapter.name} does not support instrumentation.server`);
}

Type guard

function adapterSupportsInstrumentation(adapter) {
  return Boolean(adapter?.supports?.instrumentation?.());
}

Try / catch

try {
  await startDevServer();
} catch (err) {
  if (/is unsupported in .*adapter/i.test(err.message)) {
    console.error('Remove instrumentation.server or switch to a supporting adapter');
  }
  throw err;
}

Prevention

When it happens

Trigger: Adding `src/instrumentation.server.ts` while using an adapter (e.g. an older adapter or one without instrumentation support) whose `supports.instrumentation()` returns false.

Common situations: Following an OpenTelemetry/tracing tutorial without checking adapter compatibility; upgrading SvelteKit but not the adapter; using a custom/community adapter that hasn't implemented the capability check.

Related errors


AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02). Data as JSON: /api/errors/149feb2e0d140cf6. Report an issue: GitHub.