{"record":{"id":"5d6ae7f5e4ec40a7","repo":"sveltejs/kit","slug":"the-sveltekit-vite-plugin-keypath-should-be-an","errorCode":null,"errorMessage":"The SvelteKit Vite plugin ${keypath} should be an object with an `adapt` method. See https://svelte.dev/docs/kit/adapters","messagePattern":"The SvelteKit Vite plugin (.+?) should be an object with an `adapt` method\\. See https://svelte\\.dev/docs/kit/adapters","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/core/config/options.js","lineNumber":49,"sourceCode":"\t'trusted-types': string_array(),\n\t'upgrade-insecure-requests': boolean(false),\n\t'require-sri-for': string_array(),\n\t'block-all-mixed-content': boolean(false),\n\t'plugin-types': string_array(),\n\treferrer: string_array()\n});\n\nconst prerender_handler = validate(undefined, (input, keypath) => {\n\tif (typeof input === 'function') return input;\n\tif (['fail', 'warn', 'ignore'].includes(input)) return input;\n\tthrow new Error(`${keypath} should be \"fail\", \"warn\", \"ignore\" or a custom function`);\n});\n\nconst options = {\n\tadapter: validate(undefined, (input, keypath) => {\n\t\tif (typeof input !== 'object' || !input.adapt) {\n\t\t\tconst message = `The SvelteKit Vite plugin ${keypath} should be an object with an \\`adapt\\` method`;\n\t\t\tthrow new Error(`${message}. See https://svelte.dev/docs/kit/adapters`);\n\t\t}\n\n\t\treturn input;\n\t}),\n\n\talias: deprecate(\n\t\tvalidate({}, (input, keypath) => {\n\t\t\tif (typeof input !== 'object') {\n\t\t\t\tthrow new Error(`${keypath} should be an object`);\n\t\t\t}\n\n\t\t\tfor (const key in input) {\n\t\t\t\tassert_string(input[key], `${keypath}.${key}`);\n\t\t\t}\n\n\t\t\treturn input;\n\t\t}),\n\t\t(keypath) =>","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/config/options.js#L31-L67","documentation":"`kit.adapter` must be an adapter object exposing an `adapt` method — i.e. the result of calling an adapter package like @sveltejs/adapter-node or adapter-auto. The validator throws when the value is not such an object, most often because the adapter package was not actually invoked or is missing.","triggerScenarios":"validate_options processes config.kit.adapter and finds typeof input !== 'object' or input.adapt is falsy: e.g. `adapter: adapterNode` (the module, not the call result), `adapter: '@sveltejs/adapter-node'` (a string), or an adapter package not installed.","commonSituations":"Forgetting to call the adapter factory (`adapter: adapter` instead of `adapter: adapter()`); assigning the package name as a string; importing the wrong export from an adapter package; adapter not in package.json dependencies.","solutions":["Call the adapter factory and pass the result: `adapter: adapter({ ...options })`.","Ensure the adapter package is installed (`pnpm i -D @sveltejs/adapter-node`) and imported correctly (`import adapter from '@sveltejs/adapter-node'`).","Remove any string/placeholder values and use a real adapter object."],"exampleFix":"// before\nimport adapter from '@sveltejs/adapter-node';\nkit: { adapter }\n// after\nimport adapter from '@sveltejs/adapter-node';\nkit: { adapter: adapter() }","handlingStrategy":"type-guard","validationCode":"import adapter from '@sveltejs/adapter-node';\nconst a = adapter();\nif (typeof a !== 'object' || typeof a.adapt !== 'function') {\n  throw new Error('kit.adapter must be the result of calling an adapter factory');\n}","typeGuard":"/** @returns {boolean} */\nfunction isAdapter(v) {\n  return typeof v === 'object' && v !== null && typeof v.adapt === 'function';\n}","tryCatchPattern":"try {\n  await viteBuild();\n} catch (e) {\n  if (e.message.includes(\"should be an object with an `adapt` method\")) {\n    console.error('Call the adapter factory: adapter: adapter()');\n  }\n  throw e;\n}","preventionTips":["Always invoke the adapter factory: `adapter: adapter()`","Never pass the package name string or the uninvited module as adapter","Keep the adapter package in devDependencies and import its default export","Scaffold adapters with the official setup tool to get correct wiring"],"tags":["config","adapter","validation","api-misuse"],"backgroundTag":"invalid-adapter-config","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}