{"record":{"id":"f8549657f66d419d","repo":"sveltejs/kit","slug":"message-since-you-re-using-sveltejs-adapter-a","errorCode":null,"errorMessage":"${message}. Since you're using @sveltejs/adapter-auto, SvelteKit cannot determine whether it will work when your app is deployed. Please replace it with an adapter tailored to your target environment.","messagePattern":"(.+?)\\. Since you're using @sveltejs/adapter-auto, SvelteKit cannot determine whether it will work when your app is deployed\\. Please replace it with an adapter tailored to your target environment\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-auto/index.js","lineNumber":169,"sourceCode":"\tsupports: {\n\t\tread: () => {\n\t\t\tsupports_error(\n\t\t\t\t'The read function imported from $app/server only works in certain environments'\n\t\t\t);\n\t\t},\n\t\tinstrumentation: () => {\n\t\t\tsupports_error('`instrumentation.server.js` only works in certain environments');\n\t\t}\n\t}\n});\n\n/**\n * @param {string} message\n * @returns {never}\n * @throws {Error}\n */\nfunction supports_error(message) {\n\tthrow new Error(\n\t\t`${message}. Since you're using @sveltejs/adapter-auto, SvelteKit cannot determine whether it will work when your app is deployed. Please replace it with an adapter tailored to your target environment.`\n\t);\n}\n","sourceCodeStart":151,"sourceCodeEnd":173,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/adapter-auto/index.js#L151-L173","documentation":"This is the shared error formatter for adapter-auto's `supports` checks. adapter-auto has no real deployment target, so it cannot guarantee a capability (like reading from the filesystem at runtime) will work once deployed, and it refuses with this message telling you to pick a target-specific adapter.","triggerScenarios":"SvelteKit build or runtime called a capability check on the adapter-auto adapter (e.g. builder.supports.read or supports.response for a route using those features) — the corresponding supports_* function invokes supports_error with a message describing the unsupported feature.","commonSituations":"Routes using builder.read() (filesystem access via $lib/server read) while still on adapter-auto; prerender/headers features exercised during build that adapter-auto cannot validate.","solutions":["Replace @sveltejs/adapter-auto with the adapter for your actual deployment target in svelte.config.js.","If you must read files at runtime, choose an adapter whose supports.read returns true (e.g. adapter-node, adapter-bun).","If the feature is only needed for one route, remove or guard it so the capability check is never hit."],"exampleFix":"// before\nimport adapter from '@sveltejs/adapter-auto';\n// after\nimport adapter from '@sveltejs/adapter-node';\nexport default { kit: { adapter: adapter() } };","handlingStrategy":"validation","validationCode":"import fs from 'node:fs/promises';\n// guard: fail early if runtime file reads are used with adapter-auto\nconst src = await fs.readFile('src/routes/+page.server.js', 'utf8');\nif (/builder\\.read|\\bread\\(/.test(src)) {\n  throw new Error('adapter-auto cannot guarantee runtime file reads — use adapter-node/bun');\n}","typeGuard":"const supportsRead = (adapter) => {\n  try { adapter.supports?.read({ routes: [] }); return true; }\n  catch { return false; }\n};","tryCatchPattern":"try {\n  await builder.read('data.json');\n} catch (e) {\n  if (/adapter-auto, SvelteKit cannot determine/.test(e.message)) {\n    throw new Error('Feature unsupported by adapter-auto — switch to a target-specific adapter', { cause: e });\n  }\n  throw e;\n}","preventionTips":["Deploy with a concrete adapter, not adapter-auto, when using filesystem features","Avoid builder.read() while on adapter-auto","Run a local smoke build to surface supports errors before CI"],"tags":["adapter-auto","unsupported-feature","build"],"backgroundTag":"adapter-capability-unsupported","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}