{"record":{"id":"149feb2e0d140cf6","repo":"sveltejs/kit","slug":"resolved-instrumentation-is-unsupported-in-sv","errorCode":null,"errorMessage":"${resolved_instrumentation} is unsupported in ${svelte_config.adapter.name}.","messagePattern":"(.+?) is unsupported in (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/exports/vite/dev/index.js","lineNumber":369,"sourceCode":"\t\t\t\t\t\t});\n\t\t\t\t\t\tres.end(`import '${svelte_config.paths.base}${to_fs(resolved)}';`);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tres.writeHead(404);\n\t\t\t\t\t\tres.end('not found');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// resolve the instrumentation file per request so that changes to it\n\t\t\t\t// are picked up on new requests\n\t\t\t\tconst resolved_instrumentation = resolve_entry(\n\t\t\t\t\tpath.join(svelte_config.files.src, 'instrumentation.server')\n\t\t\t\t);\n\n\t\t\t\tif (resolved_instrumentation) {\n\t\t\t\t\tif (svelte_config.adapter && !svelte_config.adapter.supports?.instrumentation?.()) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`${resolved_instrumentation} is unsupported in ${svelte_config.adapter.name}.`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { set_env } = await runner.import('<sveltekit:generated>/env/config.js');\n\t\t\t\t\tset_env(env);\n\t\t\t\t\tawait runner.import(resolved_instrumentation);\n\t\t\t\t}\n\n\t\t\t\t// we have to import `Server` before calling `set_assets`\n\t\t\t\tconst { Server } = /** @type {ServerModule} */ (\n\t\t\t\t\tawait runner.import(`${get_runtime_base(root)}/server/index.js`)\n\t\t\t\t);\n\n\t\t\t\tconst { set_fix_stack_trace, format_response } = await runner.import(\n\t\t\t\t\t`${get_runtime_base(root)}/server/internal.js`\n\t\t\t\t);\n\t\t\t\tset_fix_stack_trace(fix_stack_trace);","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/exports/vite/dev/index.js#L351-L387","documentation":"`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.","triggerScenarios":"Adding `src/instrumentation.server.ts` while using an adapter (e.g. an older adapter or one without instrumentation support) whose `supports.instrumentation()` returns false.","commonSituations":"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.","solutions":["Upgrade the adapter to a version that supports instrumentation","Remove or rename `src/instrumentation.server.*` if not needed","Switch to an adapter that supports instrumentation (e.g. adapter-node)","Implement initialization directly in `hooks.server.ts` instead of instrumentation"],"exampleFix":"// before\n// src/instrumentation.server.ts  + adapter that lacks instrumentation support\n// after\n// move tracing setup into src/hooks.server.ts (or upgrade adapter-node)\nexport async function handle({ event, resolve }) {\n  await initTracing();\n  return resolve(event);\n}","handlingStrategy":"validation","validationCode":"// before adding src/instrumentation.server.ts, check adapter support:\nif (adapter.supports && !adapter.supports.instrumentation?.()) {\n  throw new Error(`${adapter.name} does not support instrumentation.server`);\n}","typeGuard":"function adapterSupportsInstrumentation(adapter) {\n  return Boolean(adapter?.supports?.instrumentation?.());\n}","tryCatchPattern":"try {\n  await startDevServer();\n} catch (err) {\n  if (/is unsupported in .*adapter/i.test(err.message)) {\n    console.error('Remove instrumentation.server or switch to a supporting adapter');\n  }\n  throw err;\n}","preventionTips":["Check the adapter docs for instrumentation support before adding the file","Keep the adapter package updated to the latest version","Prefer hooks.server.ts for setup logic when adapter support is uncertain"],"tags":["adapter","instrumentation","config","compatibility"],"backgroundTag":"adapter-capability-unsupported","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}