paperclipai/paperclip · error

Failed to load manifest module at ${manifestPath}: ${String(

Error message

Failed to load manifest module at ${manifestPath}: ${String(err)}

What it means

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.

Source

Thrown at server/src/services/plugin-loader.ts:1348

  /**
   * Attempt to load and validate a plugin manifest from a resolved path.
   * Returns the manifest on success or throws with a descriptive error.
   */
  async function loadManifestFromPath(
    manifestPath: string,
  ): Promise<PaperclipPluginManifestV1> {
    let raw: unknown;

    try {
      // Dynamic import works for both .js (ESM) and .cjs (CJS) manifests
      const manifestUrl = pathToFileURL(manifestPath);
      const manifestStat = await stat(manifestPath);
      manifestUrl.searchParams.set("mtime", String(Math.trunc(manifestStat.mtimeMs)));
      const mod = await import(manifestUrl.href) as Record<string, unknown>;
      // The manifest may be the default export or the module itself
      raw = mod["default"] ?? mod;
    } catch (err) {
      throw new Error(
        `Failed to load manifest module at ${manifestPath}: ${String(err)}`,
      );
    }

    return manifestValidator.parseOrThrow(raw);
  }

  async function loadManifestFromPackageRoot(
    packageRoot: string,
  ): Promise<PaperclipPluginManifestV1 | null> {
    const pkgJson = await readPackageJson(packageRoot);
    if (!pkgJson) return null;

    const manifestPath = resolveManifestPath(packageRoot, pkgJson);
    if (!manifestPath || !existsSync(manifestPath)) return null;

    return loadManifestFromPath(manifestPath);
  }

View on GitHub (pinned to 120ae5428f)

Solutions

  1. Fix the manifest module load error shown (syntax error, missing dependency, or bad export) and rebuild the plugin.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at server/src/services/plugin-loader.ts:1348 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/91b351d4afbae61f. Report an issue: GitHub.