{"record":{"id":"98e678c4a230d582","repo":"sveltejs/kit","slug":"instrumentation-initializer-initializer-not-fou","errorCode":null,"errorMessage":"Instrumentation initializer ${initializer} not found. This is probably a bug in your adapter.","messagePattern":"Instrumentation initializer (.+?) 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":337,"sourceCode":"\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}\n\n\t\t\tconst relative_instrumentation = posixify(\n\t\t\t\tpath.relative(path.dirname(entrypoint), instrumentation)\n\t\t\t);\n\t\t\tconst relative_start = posixify(path.relative(path.dirname(entrypoint), start));\n\t\t\tconst relative_initializer = posixify(path.relative(path.dirname(entrypoint), initializer));\n\n\t\t\tconst facade =\n\t\t\t\t'generateText' in module\n\t\t\t\t\t? module.generateText({","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/adapt/builder.js#L319-L355","documentation":"Third guard in `builder.instrument`: the optional instrumentation initializer file must exist if the adapter passed one. Missing initializer means the adapter referenced a file it never emitted — flagged as an adapter bug.","triggerScenarios":"`instrument` is called with an `initializer` path and `existsSync(initializer)` is false.","commonSituations":"Adapter bug, stale/partial build output, or adapter/SvelteKit version mismatch changing where the initializer is generated.","solutions":["Update the adapter to a SvelteKit-compatible version","Clean build output and rebuild","Report the bug to the adapter maintainers if it persists"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nif (initializer && !existsSync(initializer)) {\n  console.error('Initializer missing; adapt config before calling instrument()');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only pass `initializer` when your adapter actually emits that file","Rebuild from a clean output directory on weird failures","Pin adapter versions tested against your SvelteKit version"],"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"}