sveltejs/kit · error · Error

Instrumentation initializer ${initializer} not found. This i

Error message

Instrumentation initializer ${initializer} not found. This is probably a bug in your adapter.

What it means

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.

Source

Thrown at packages/kit/src/core/adapt/builder.js:337

			instrumentation,
			start = path.join(path.dirname(entrypoint), 'start.js'),
			initializer,
			module = {
				exports: ['default']
			}
		}) {
			if (!existsSync(instrumentation)) {
				throw new Error(
					`Instrumentation file ${instrumentation} not found. This is probably a bug in your adapter.`
				);
			}
			if (!existsSync(entrypoint)) {
				throw new Error(
					`Entrypoint file ${entrypoint} not found. This is probably a bug in your adapter.`
				);
			}
			if (!existsSync(initializer)) {
				throw new Error(
					`Instrumentation initializer ${initializer} not found. This is probably a bug in your adapter.`
				);
			}

			copy(entrypoint, start);
			if (existsSync(`${entrypoint}.map`)) {
				copy(`${entrypoint}.map`, `${start}.map`);
			}

			const relative_instrumentation = posixify(
				path.relative(path.dirname(entrypoint), instrumentation)
			);
			const relative_start = posixify(path.relative(path.dirname(entrypoint), start));
			const relative_initializer = posixify(path.relative(path.dirname(entrypoint), initializer));

			const facade =
				'generateText' in module
					? module.generateText({

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Update the adapter to a SvelteKit-compatible version
  2. Clean build output and rebuild
  3. Report the bug to the adapter maintainers if it persists
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from 'node:fs';
if (initializer && !existsSync(initializer)) {
  console.error('Initializer missing; adapt config before calling instrument()');
}

Prevention

When it happens

Trigger: `instrument` is called with an `initializer` path and `existsSync(initializer)` is false.

Common situations: Adapter bug, stale/partial build output, or adapter/SvelteKit version mismatch changing where the initializer is generated.

Related errors


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