{"record":{"id":"3b41904b58a45c1a","repo":"paperclipai/paperclip","slug":"unable-to-resolve-module-import-at-path-candida","errorCode":null,"errorMessage":"Unable to resolve module import at path '${candidatePath}'","messagePattern":"Unable to resolve module import at path '(.+?)'","errorType":"exception","errorClass":"PluginSandboxError","httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-runtime-sandbox.ts","lineNumber":186,"sourceCode":"    return normalizedExports;\n  };\n\n  const entryExports = loadModuleSync(entrypointPath);\n\n  return {\n    namespace: { ...entryExports },\n  };\n}\n\nfunction resolveModulePathSync(candidatePath: string): string {\n  for (const suffix of MODULE_PATH_SUFFIXES) {\n    const fullPath = `${candidatePath}${suffix}`;\n    if (existsSync(fullPath)) {\n      return fullPath;\n    }\n  }\n\n  throw new PluginSandboxError(`Unable to resolve module import at path '${candidatePath}'`);\n}\n\n/**\n * True when `targetPath` is inside `rootPath` (or equals rootPath), false otherwise.\n * Uses `path.relative` so sibling-prefix paths (e.g. `/root-a` vs `/root`) cannot bypass checks.\n */\nfunction isWithinRoot(targetPath: string, rootPath: string): boolean {\n  const relative = path.relative(rootPath, targetPath);\n  return relative === \"\" || (!relative.startsWith(\"..\") && !path.isAbsolute(relative));\n}\n\nfunction readModuleSourceSync(modulePath: string): string {\n  try {\n    return readFileSync(modulePath, \"utf8\");\n  } catch (error) {\n    throw new PluginSandboxError(\n      `Failed to read sandbox module '${modulePath}': ${error instanceof Error ? error.message : String(error)}`,\n    );","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/plugin-runtime-sandbox.ts#L168-L204","documentation":"Resolution guard in resolveModulePathSync: none of the candidate paths plus known suffixes (.js, /index.js, etc.) exist on disk. The imported file is missing or the specifier is wrong; the unresolvable import path is at fault.","triggerScenarios":"Thrown at server/src/services/plugin-runtime-sandbox.ts:186 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the import path: the file does not exist at the resolved candidate. Check the path, extension, and that the file ships with the plugin build."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}