{"record":{"id":"195bc96451c4b452","repo":"paperclipai/paperclip","slug":"could-not-locate-a-paperclip-server-entrypoint-tr","errorCode":null,"errorMessage":"Could not locate a Paperclip server entrypoint.\nTried: ${devEntry}, @paperclipai/server\n${formatError(err)}","messagePattern":"Could not locate a Paperclip server entrypoint\\.\nTried: (.+?), @paperclipai/server\n(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/run.ts","lineNumber":230,"sourceCode":"    );\n  }\n\n  if ((result.status ?? 1) !== 0) {\n    throw new Error(\n      \"Failed to prepare workspace build artifacts before starting the Paperclip dev server.\",\n    );\n  }\n}\n\nasync function importServerEntry(): Promise<StartedServer> {\n  // Dev mode: try local workspace path (monorepo with tsx)\n  const projectRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), \"../../..\");\n  const devEntry = path.resolve(projectRoot, \"server/src/index.ts\");\n  if (fs.existsSync(devEntry)) {\n    ensureDevWorkspaceBuildDeps(projectRoot);\n    maybeEnableUiDevMiddleware(devEntry);\n    const mod = await import(pathToFileURL(devEntry).href);\n    return await startServerFromModule(mod, devEntry);\n  }\n\n  // Production mode: import the published @paperclipai/server package\n  try {\n    const mod = await import(\"@paperclipai/server\");\n    return await startServerFromModule(mod, \"@paperclipai/server\");\n  } catch (err) {\n    const missingSpecifier = getMissingModuleSpecifier(err);\n    const missingServerEntrypoint = !missingSpecifier || missingSpecifier === \"@paperclipai/server\";\n    if (isModuleNotFoundError(err) && missingServerEntrypoint) {\n      throw new Error(\n        `Could not locate a Paperclip server entrypoint.\\n` +\n          `Tried: ${devEntry}, @paperclipai/server\\n` +\n          `${formatError(err)}`,\n      );\n    }\n    throw new Error(\n      `Paperclip server failed to start.\\n` +","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/run.ts#L212-L248","documentation":"importServerEntry tried both the local dev entrypoint and the published @paperclipai/server package and both imports failed; the wrapped error lists what was attempted and the underlying failure.","triggerScenarios":"Thrown at cli/src/commands/run.ts:204 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run from a Paperclip repo checkout or install @paperclipai/server so a server entrypoint is resolvable."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}