sveltejs/kit · error · Error

Instrumentation file ${instrumentation} not found. This is p

Error message

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

What it means

`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.

Source

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

			return initializer;
		},

		hasServerInstrumentationFile() {
			return existsSync(`${config.outDir}/output/server/instrumentation.server.js`);
		},

		instrument({
			entrypoint,
			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`);
			}

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Update the adapter to a version compatible with your SvelteKit version
  2. Ensure your project actually defines an instrumentation server file (src/instrumentation.server.js) if the adapter expects one
  3. Disable the adapter's instrumentation option if you don't need it
Defensive patterns

Strategy: validation

Validate before calling

// adapter author: verify before calling builder.instrument
import { existsSync } from 'node:fs';
if (adapterOptions.instrumentation && !existsSync(instrumentationPath)) {
  console.error('instrumentation file missing; skipping builder.instrument()');
}

Prevention

When it happens

Trigger: `instrument` is called with an `instrumentation` path for which `existsSync` is false during adaptation.

Common situations: An adapter enabling instrumentation when the project provides none, or adapter/internal mismatch after upgrading SvelteKit so expected file names/locations drifted.

Related errors


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