openclaw - 💡(How to fix) Fix Bug: 2026.3.11 fails to start — @mariozechner/pi-ai missing getOAuthApiKey / getEnvApiKey exports from main index [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#43753Fetched 2026-04-08 00:17:29
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Timeline (top)
commented ×1

Error Message

Immediately on any CLI invocation (openclaw --version, openclaw doctor --fix, etc.):

[openclaw] Failed to start CLI: file:///path/to/openclaw/dist/auth-profiles-CJiHNd6F.js:27
import { createAssistantMessageEventStream, getEnvApiKey, getOAuthApiKey, getOAuthProviders } from "@mariozechner/pi-ai";
                                                          ^^^^^^^^^^^^^^
SyntaxError: The requested module '@mariozechner/pi-ai' does not provide an export named 'getOAuthApiKey'

Root Cause

The pre-built dist file dist/auth-profiles-CJiHNd6F.js imports getOAuthApiKey and getOAuthProviders from the @mariozechner/pi-ai top-level package. These functions exist in the package under dist/utils/oauth/index.js (and are accessible via the @mariozechner/pi-ai/oauth subpath export), but they are not re-exported from the main dist/index.js.

The package's dist/index.js does not include export * from "./utils/oauth/index.js".

Fix Action

Workaround

Manually patching node_modules/@mariozechner/pi-ai/dist/index.js to add:

export * from "./utils/oauth/index.js";

restores normal operation. This is a node_modules patch so it will be lost on reinstall.

Code Example

[openclaw] Failed to start CLI: file:///path/to/openclaw/dist/auth-profiles-CJiHNd6F.js:27
import { createAssistantMessageEventStream, getEnvApiKey, getOAuthApiKey, getOAuthProviders } from "@mariozechner/pi-ai";
                                                          ^^^^^^^^^^^^^^
SyntaxError: The requested module '@mariozechner/pi-ai' does not provide an export named 'getOAuthApiKey'

---

export * from "./utils/oauth/index.js";
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw: 2026.3.11 (from source, git tag v2026.3.11)
  • @mariozechner/pi-ai: 0.57.1 (latest on npm)
  • Node: v22.22.0
  • OS: macOS 15 (arm64)

Error

Immediately on any CLI invocation (openclaw --version, openclaw doctor --fix, etc.):

[openclaw] Failed to start CLI: file:///path/to/openclaw/dist/auth-profiles-CJiHNd6F.js:27
import { createAssistantMessageEventStream, getEnvApiKey, getOAuthApiKey, getOAuthProviders } from "@mariozechner/pi-ai";
                                                          ^^^^^^^^^^^^^^
SyntaxError: The requested module '@mariozechner/pi-ai' does not provide an export named 'getOAuthApiKey'

Root Cause

The pre-built dist file dist/auth-profiles-CJiHNd6F.js imports getOAuthApiKey and getOAuthProviders from the @mariozechner/pi-ai top-level package. These functions exist in the package under dist/utils/oauth/index.js (and are accessible via the @mariozechner/pi-ai/oauth subpath export), but they are not re-exported from the main dist/index.js.

The package's dist/index.js does not include export * from "./utils/oauth/index.js".

Workaround

Manually patching node_modules/@mariozechner/pi-ai/dist/index.js to add:

export * from "./utils/oauth/index.js";

restores normal operation. This is a node_modules patch so it will be lost on reinstall.

Expected Fix

Either:

  1. Publish @mariozechner/[email protected] with getOAuthApiKey / getOAuthProviders re-exported from the main index, or
  2. Update the OpenClaw build to import these from @mariozechner/pi-ai/oauth instead of the top-level package

Impact

Blocks all CLI usage on fresh installs of 2026.3.11. Anyone installing via npm (npm install -g openclaw) will hit this on first run.

extent analysis

Fix Plan

To resolve the issue, we can update the import statements in the OpenClaw code to import the required functions from the correct subpath.

Step-by-Step Solution

  • Update the import statement in dist/auth-profiles-CJiHNd6F.js to:
import { createAssistantMessageEventStream } from "@mariozechner/pi-ai";
import { getOAuthApiKey, getOAuthProviders } from "@mariozechner/pi-ai/oauth";
  • Alternatively, if you prefer to wait for the @mariozechner/pi-ai package to be updated, you can use the workaround by patching node_modules/@mariozechner/pi-ai/dist/index.js to include:
export * from "./utils/oauth/index.js";

However, this patch will be lost on reinstall.

Verification

To verify that the fix worked, run the following command:

openclaw --version

If the fix was successful, this command should execute without errors.

Extra Tips

  • Make sure to update the import statements in all relevant files to avoid similar issues in the future.
  • Consider submitting a pull request to the @mariozechner/pi-ai repository to include the missing re-exports in the main index file.
  • If you are using a package manager like npm, consider using a lockfile to ensure that dependencies are installed with the correct versions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING