{"record":{"id":"ea6c2dc6f14e7a62","repo":"paperclipai/paperclip","slug":"paperclip-server-entrypoint-did-not-export-startse","errorCode":null,"errorMessage":"Paperclip server entrypoint did not export startServer(): ${label}","messagePattern":"Paperclip server entrypoint did not export startServer\\(\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"cli/src/commands/run.ts","lineNumber":224,"sourceCode":"          `Tried: ${devEntry}, @paperclipai/server\\n` +\n          `${formatError(err)}`,\n      );\n    }\n    throw new Error(\n      `Paperclip server failed to start.\\n` +\n        `${formatError(err)}`,\n    );\n  }\n}\n\nfunction shouldGenerateBootstrapInviteAfterStart(config: PaperclipConfig): boolean {\n  return config.server.deploymentMode === \"authenticated\" && config.database.mode === \"embedded-postgres\";\n}\n\nasync function startServerFromModule(mod: unknown, label: string): Promise<StartedServer> {\n  const startServer = (mod as { startServer?: () => Promise<StartedServer> }).startServer;\n  if (typeof startServer !== \"function\") {\n    throw new Error(`Paperclip server entrypoint did not export startServer(): ${label}`);\n  }\n  return await startServer();\n}\n","sourceCodeStart":206,"sourceCodeEnd":228,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/run.ts#L206-L228","documentation":"Thrown by startServerFromModule() when the imported server module does not expose a `startServer` function. The entrypoint resolved and imported but its public API is incompatible — most likely a version mismatch between the CLI and the server package.","triggerScenarios":"The dev `server/src/index.ts` or `@paperclipai/server` imported successfully but `(mod as {startServer?}).startServer` is undefined or not a function. Common when the server package version predates the startServer export, or a custom/aliased module is loaded that lacks the export.","commonSituations":"CLI and server package versions are out of sync (e.g. newer CLI, older globally installed server); a local file shadows @paperclipai/server; a corrupted/partial build of the server left out the entry export.","solutions":["Align versions: ensure the installed `@paperclipai/server` matches the CLI's expected version (check package.json / lockfile).","Reinstall both packages together from a clean lockfile.","If developing in the monorepo, rebuild the server package: `pnpm --filter @paperclipai/server build`.","Confirm no local file is shadowing the package via NODE_PATH/paths or a stray `node_modules/@paperclipai/server`."],"exampleFix":"// before: stale server export\nmod.startServer // undefined\n// after: rebuild/align server\npnpm --filter @paperclipai/server build\npnpm install","handlingStrategy":"type-guard","validationCode":"function hasStartServer(mod: unknown): mod is { startServer: () => Promise<unknown> } {\n  return typeof (mod as any)?.startServer === 'function';\n}\nif (!hasStartServer(mod)) throw new Error(`Incompatible server module: ${label}`);","typeGuard":"function isServerModule(mod: unknown): mod is { startServer: () => Promise<unknown> } {\n  return mod !== null && typeof mod === 'object' && typeof (mod as { startServer?: unknown }).startServer === 'function';\n}","tryCatchPattern":null,"preventionTips":["Keep CLI and @paperclipai/server versions in sync via a shared lockfile.","Rebuild the server package after edits so the published export reflects changes."],"tags":["server","entrypoint","export","version-mismatch","run"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}