{"record":{"id":"f26c91fc1563c721","repo":"moeru-ai/airi","slug":"extension-entrypoint-is-required-for-runtime-ru","errorCode":null,"errorMessage":"Extension entrypoint is required for runtime `${runtime}`. Define one of `entrypoints.<runtime>`, `entrypoints.default`, or `entrypoints.electron` in the extension manifest.","messagePattern":"Extension entrypoint is required for runtime `(.+?)`\\. Define one of `entrypoints\\.<runtime>`, `entrypoints\\.default`, or `entrypoints\\.electron` in the extension manifest\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugin-sdk/src/plugin-host/runtimes/node/loaders/fs.ts","lineNumber":62,"sourceCode":"export class FileSystemLoader {\n  /**\n   * Resolve a manifest entrypoint for the requested runtime.\n   *\n   * Resolution order:\n   * 1) `entrypoints.<runtime>`\n   * 2) `entrypoints.default`\n   * 3) `entrypoints.electron` (legacy fallback for current local extension manifests)\n   */\n  resolveEntrypointFor(manifest: ExtensionManifestV1, options?: ExtensionLoadOptions) {\n    const runtime = options?.runtime ?? 'electron'\n    const root = options?.cwd ?? cwd()\n    const entrypoint\n      = manifest.entrypoints[runtime]\n        ?? manifest.entrypoints.default\n        ?? manifest.entrypoints.electron\n\n    if (!entrypoint) {\n      throw new Error(''\n        + `Extension entrypoint is required for runtime \\`${runtime}\\`. `\n        + 'Define one of `entrypoints.<runtime>`, `entrypoints.default`, '\n        + 'or `entrypoints.electron` in the extension manifest.',\n      )\n    }\n\n    return isAbsolute(entrypoint) ? entrypoint : join(root, entrypoint)\n  }\n\n  async loadExtensionFor(manifest: ExtensionManifestV1, options?: ExtensionLoadOptions) {\n    const entrypoint = this.resolveEntrypointFor(manifest, options)\n    const extensionModule = await import(entrypoint)\n    return coerceExtensionFromModule(extensionModule)\n  }\n}\n","sourceCodeStart":44,"sourceCodeEnd":78,"githubUrl":"https://github.com/moeru-ai/airi/blob/27111382b4a79a7e983289d6e983a06af185ed0f/packages/plugin-sdk/src/plugin-host/runtimes/node/loaders/fs.ts#L44-L78","documentation":"Thrown by FileSystemLoader.resolveEntrypointFor() when none of entrypoints[runtime], entrypoints.default, or entrypoints.electron (legacy fallback) are defined on the extension manifest. The loader cannot determine which file to import for the requested runtime.","triggerScenarios":"Calling host.start(manifest, { runtime }) or loadExtensionFor(manifest, { runtime }) where the manifest's `entrypoints` object has no key for the requested runtime, no `default`, and no `electron` fallback. The runtime defaults to 'electron' when omitted.","commonSituations":"Manifest declares only a web or node entrypoint but the host/session runtime is 'electron' (the default). Manifest's entrypoints object is empty or missing. A typo in the runtime key (e.g. 'nodejs' instead of 'node'). Copying a manifest template that omits entrypoints.","solutions":["Add `entrypoints.default` to the manifest pointing at a runtime-agnostic entry, so all runtimes fall back to it.","Or add a runtime-specific entry: `entrypoints.electron`, `entrypoints.node`, or `entrypoints.web` matching the host/session runtime.","Ensure the runtime passed to host.start matches a key present in entrypoints, or set entrypoints.default as a catch-all."],"exampleFix":"// before — manifest has no entrypoint for electron (the default runtime)\n{ \"apiVersion\": \"v1\", \"kind\": \"manifest.extension.airi.moeru.ai\", \"id\": \"my-ext\",\n  \"permissions\": {}, \"entrypoints\": { \"web\": \"./web.js\" } }\n\n// after — add default fallback\n{ \"apiVersion\": \"v1\", \"kind\": \"manifest.extension.airi.moeru.ai\", \"id\": \"my-ext\",\n  \"permissions\": {}, \"entrypoints\": { \"default\": \"./index.js\", \"web\": \"./web.js\" } }","handlingStrategy":"validation","validationCode":"const runtime = options?.runtime ?? 'electron'\nconst entrypoint = manifest.entrypoints[runtime]\n  ?? manifest.entrypoints.default\n  ?? manifest.entrypoints.electron\nif (!entrypoint) {\n  throw new Error(`No entrypoint for runtime '${runtime}'. Add entrypoints.default or entrypoints.${runtime}.`)\n}","typeGuard":"function manifestHasEntryForRuntime(manifest: ExtensionManifestV1, runtime: string): boolean {\n  return Boolean(manifest.entrypoints[runtime as keyof typeof manifest.entrypoints]\n    ?? manifest.entrypoints.default\n    ?? manifest.entrypoints.electron)\n}","tryCatchPattern":"try {\n  await host.start(manifest, { runtime })\n} catch (error) {\n  if (error instanceof Error && /Extension entrypoint is required for runtime/.test(error.message)) {\n    // add entrypoints.default or entrypoints.<runtime> to the manifest, then retry\n  } else {\n    throw error\n  }\n}","preventionTips":["Always set entrypoints.default as a catch-all so any runtime can resolve the entrypoint.","Ensure the runtime passed to host.start has a matching key in entrypoints.","Validate the manifest's entrypoints object is non-empty before starting."],"tags":["manifest","entrypoint","loader","runtime","configuration"],"backgroundTag":null,"analyzedSha":"27111382b4a79a7e983289d6e983a06af185ed0f","analyzedAt":"2026-08-12T18:33:34.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}