{"record":{"id":"9f0a4c9516f978e5","repo":"sveltejs/kit","slug":"could-not-detect-a-supported-production-environmen","errorCode":null,"errorMessage":"Could not detect a supported production environment. See https://svelte.dev/docs/kit/adapters to learn how to configure your app to run on the platform of your choosing","messagePattern":"Could not detect a supported production environment\\. See https://svelte\\.dev/docs/kit/adapters to learn how to configure your app to run on the platform of your choosing","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/adapter-auto/index.js","lineNumber":147,"sourceCode":"\n\treturn {\n\t\t...adapter,\n\t\tadapt: (builder) => {\n\t\t\tbuilder.log.info(`Detected environment: ${match.name}. Using ${match.module}`);\n\t\t\treturn adapter.adapt(builder);\n\t\t}\n\t};\n}\n\n/** @type {typeof import('./index.js').default} */\nexport default () => ({\n\tname: '@sveltejs/adapter-auto',\n\tadapt: async (builder) => {\n\t\tconst adapter = await get_adapter();\n\n\t\tif (adapter) return adapter.adapt(builder);\n\n\t\tbuilder.log.warn(\n\t\t\t'Could not detect a supported production environment. See https://svelte.dev/docs/kit/adapters to learn how to configure your app to run on the platform of your choosing'\n\t\t);\n\t},\n\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}","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/adapter-auto/index.js#L129-L165","documentation":"adapter-auto's `adapt` step could not identify the hosting platform from environment variables and no suitable adapter is installed. The build succeeds, but no server output suited to production is produced, and this warning explains how to pick an adapter.","triggerScenarios":"Running a production build on a machine/CI with none of the detected platform env vars (VERCEL, NETLIFY, CLOUDFULARE, etc.) and no explicit adapter in svelte.config.js; `get_adapter()` resolves to undefined.","commonSituations":"Building a Docker image or self-hosted server while still using adapter-auto; deploying to a platform adapter-auto doesn't recognize; local builds meant to test production output.","solutions":["Install and configure the adapter for your target, e.g. `@sveltejs/adapter-node` for self-hosting","Keep adapter-auto only if you deploy exclusively to a detected platform","Check CI env vars — the platform's variables must be present for auto-detection"],"exampleFix":"// svelte.config.js before\nimport adapter from '@sveltejs/adapter-auto';\n// after\nimport adapter from '@sveltejs/adapter-node';","handlingStrategy":"validation","validationCode":"// fail fast if relying on auto-detection without platform env vars\nconst detected = ['VERCEL', 'NETLIFY', 'CLOUDFLARE', 'FLY_APP_NAME'].some((v) => process.env[v]);\nif (!detected) console.warn('adapter-auto will not detect a platform; configure an explicit adapter');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Choose an explicit adapter matching your hosting target","Don't use adapter-auto for Docker/self-hosted builds","Ensure CI exposes platform env vars if you rely on auto-detection"],"tags":["adapter-auto","deployment","configuration","build"],"backgroundTag":"no-adapter-detected","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}