{"record":{"id":"102c27f3a54a4513","repo":"sveltejs/kit","slug":"instrumentation-file-instrumentation-not-found","errorCode":null,"errorMessage":"Instrumentation file ${instrumentation} not found. This is probably a bug in your adapter.","messagePattern":"Instrumentation file (.+?) not found\\. This is probably a bug in your adapter\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/core/adapt/builder.js","lineNumber":327,"sourceCode":"\n\t\t\treturn initializer;\n\t\t},\n\n\t\thasServerInstrumentationFile() {\n\t\t\treturn existsSync(`${config.outDir}/output/server/instrumentation.server.js`);\n\t\t},\n\n\t\tinstrument({\n\t\t\tentrypoint,\n\t\t\tinstrumentation,\n\t\t\tstart = path.join(path.dirname(entrypoint), 'start.js'),\n\t\t\tinitializer,\n\t\t\tmodule = {\n\t\t\t\texports: ['default']\n\t\t\t}\n\t\t}) {\n\t\t\tif (!existsSync(instrumentation)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Instrumentation file ${instrumentation} not found. This is probably a bug in your adapter.`\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!existsSync(entrypoint)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Entrypoint file ${entrypoint} not found. This is probably a bug in your adapter.`\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!existsSync(initializer)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Instrumentation initializer ${initializer} not found. This is probably a bug in your adapter.`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcopy(entrypoint, start);\n\t\t\tif (existsSync(`${entrypoint}.map`)) {\n\t\t\t\tcopy(`${entrypoint}.map`, `${start}.map`);\n\t\t\t}","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/adapt/builder.js#L309-L345","documentation":"`builder.instrument` wires an instrumentation entrypoint into the server output. It checks that the generated instrumentation file exists before copying; if missing, the adapter asked for instrumentation that SvelteKit did not produce, which the message flags as an adapter bug.","triggerScenarios":"`instrument` is called with an `instrumentation` path for which `existsSync` is false during adaptation.","commonSituations":"An adapter enabling instrumentation when the project provides none, or adapter/internal mismatch after upgrading SvelteKit so expected file names/locations drifted.","solutions":["Update the adapter to a version compatible with your SvelteKit version","Ensure your project actually defines an instrumentation server file (src/instrumentation.server.js) if the adapter expects one","Disable the adapter's instrumentation option if you don't need it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// adapter author: verify before calling builder.instrument\nimport { existsSync } from 'node:fs';\nif (adapterOptions.instrumentation && !existsSync(instrumentationPath)) {\n  console.error('instrumentation file missing; skipping builder.instrument()');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match adapter and SvelteKit versions","Only enable instrumentation when the project defines an instrumentation file","Report persistent occurrences as adapter bugs"],"tags":["sveltekit","adapter","instrumentation","internal"],"backgroundTag":"adapter-contract-violation","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}