{"record":{"id":"7f85b42a59bbde05","repo":"sveltejs/kit","slug":"the-sveltekit-vite-plugin-keypath-should-be-an-7f85b4","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":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/exports/vite/options.js","lineNumber":10,"sourceCode":"/** @import { Validator } from '../../core/config/types.js' */\n\nimport { object, validate } from '../../core/config/options.js';\n\n/** @type {Validator} */\nconst options = object({\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\nexport default options;\n","sourceCodeStart":1,"sourceCodeEnd":18,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/exports/vite/options.js#L1-L18","documentation":"The validator for the `sveltekit(...)` plugin's `adapter` option requires an object exposing an `adapt` method (an adapter instance produced by e.g. `adapter()`). Passing anything else — a module namespace instead of a called factory, a string, or an object without `adapt` — throws this error with docs link.","triggerScenarios":"Passing the adapter module instead of its factory result: `sveltekit({ adapter: adapterNode })` instead of `adapterNode()`; passing a custom object lacking `adapt`; passing a string name.","commonSituations":"Copying `import adapter from 'adapter-node'` and forgetting the `()` call; writing a custom adapter that exports the wrong shape; typo'd import that resolves to types or config instead of the factory.","solutions":["Call the adapter factory: `adapter: adapter()`","Ensure the import is the default factory function of the adapter package","If using a custom adapter, implement/expose an `adapt` method on the object","Verify the adapter package version is compatible with your SvelteKit version"],"exampleFix":"// before\nsveltekit({ adapter: adapterNode });\n// after\nsveltekit({ adapter: adapterNode() });","handlingStrategy":"type-guard","validationCode":"const adapterInstance = adapterNode?.();\nif (typeof adapterInstance !== 'object' || typeof adapterInstance?.adapt !== 'function') {\n  throw new TypeError('adapter must be the result of calling an adapter factory');\n}","typeGuard":"function isAdapter(x) {\n  return typeof x === 'object' && x !== null && typeof x.adapt === 'function';\n}","tryCatchPattern":"try {\n  const config = validatePluginOptions({ adapter });\n} catch (err) {\n  if (/should be an object with an `adapt` method/.test(err.message)) {\n    console.error('Did you forget to call the adapter factory, e.g. adapter()?');\n  }\n  throw err;\n}","preventionTips":["Always invoke the adapter: adapter(), not the imported module","Type the plugin options with an Adapter interface in TS","Double-check imports resolve to the factory default export"],"tags":["config","adapter","validation","vite"],"backgroundTag":"invalid-adapter-option","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}