{"record":{"id":"91b351d4afbae61f","repo":"paperclipai/paperclip","slug":"failed-to-load-manifest-module-at-manifestpath","errorCode":null,"errorMessage":"Failed to load manifest module at ${manifestPath}: ${String(err)}","messagePattern":"Failed to load manifest module at (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-loader.ts","lineNumber":1348,"sourceCode":"  /**\n   * Attempt to load and validate a plugin manifest from a resolved path.\n   * Returns the manifest on success or throws with a descriptive error.\n   */\n  async function loadManifestFromPath(\n    manifestPath: string,\n  ): Promise<PaperclipPluginManifestV1> {\n    let raw: unknown;\n\n    try {\n      // Dynamic import works for both .js (ESM) and .cjs (CJS) manifests\n      const manifestUrl = pathToFileURL(manifestPath);\n      const manifestStat = await stat(manifestPath);\n      manifestUrl.searchParams.set(\"mtime\", String(Math.trunc(manifestStat.mtimeMs)));\n      const mod = await import(manifestUrl.href) as Record<string, unknown>;\n      // The manifest may be the default export or the module itself\n      raw = mod[\"default\"] ?? mod;\n    } catch (err) {\n      throw new Error(\n        `Failed to load manifest module at ${manifestPath}: ${String(err)}`,\n      );\n    }\n\n    return manifestValidator.parseOrThrow(raw);\n  }\n\n  async function loadManifestFromPackageRoot(\n    packageRoot: string,\n  ): Promise<PaperclipPluginManifestV1 | null> {\n    const pkgJson = await readPackageJson(packageRoot);\n    if (!pkgJson) return null;\n\n    const manifestPath = resolveManifestPath(packageRoot, pkgJson);\n    if (!manifestPath || !existsSync(manifestPath)) return null;\n\n    return loadManifestFromPath(manifestPath);\n  }","sourceCodeStart":1330,"sourceCodeEnd":1366,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/plugin-loader.ts#L1330-L1366","documentation":"Manifest loading failure in loadManifestFromPath: the dynamic import of the compiled manifest module threw (syntax error, bad ESM/CJS, missing transitive import). Wrapper adds the manifest path to the underlying error; the broken manifest module is at fault.","triggerScenarios":"Thrown at server/src/services/plugin-loader.ts:1348 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the manifest module load error shown (syntax error, missing dependency, or bad export) and rebuild the plugin."],"exampleFix":null,"handlingStrategy":"try-catch","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-14T05:17:10.506Z"}