openclaw - 💡(How to fix) Fix Regression after 2026.4.27: ERR_PACKAGE_PATH_NOT_EXPORTED for @mariozechner/pi-ai/oauth [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#74976Fetched 2026-05-01 05:39:21
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Author
Timeline (top)
closed ×1commented ×1

Error Message

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './oauth' is not defined by exports in .../@mariozechner/pi-ai/package.json

  • lane task error ... ERR_PACKAGE_PATH_NOT_EXPORTED ... ./oauth No package export error; session should continue normally.
  • CJS require fails with same error:

Fix Action

Fix / Workaround

Repro steps

  1. Install/upgrade to [email protected]
  2. Start gateway with a config that handles Telegram sessions (embedded agent path enabled)
  3. Send a message to trigger a session
  4. Observe lane/session errors:
    • lane task error ... ERR_PACKAGE_PATH_NOT_EXPORTED ... ./oauth
    • Embedded agent failed before reply
    • session-init browser cleanup unavailable

Temporary workarounds

  • Downgrade to previous OpenClaw version (e.g. 2026.4.26)
  • Local hotfix in installed @mariozechner/pi-ai/package.json by adding default (or require) to exports[./oauth]

Request

Could maintainers confirm and patch one of:

  1. Ensure runtime never resolves @mariozechner/pi-ai/oauth through CJS require, or
  2. Add default/require export for ./oauth in the dependency path used by OpenClaw.
RAW_BUFFERClick to expand / collapse

Bug summary

After upgrading to openclaw 2026.4.27, gateway sessions intermittently fail with:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './oauth' is not defined by exports in .../@mariozechner/pi-ai/package.json

This breaks embedded agent replies and triggers model fallback.

Environment

  • OS: Windows 10 (10.0.26200)
  • Node: v22.22.1 (nvm4w)
  • OpenClaw: 2026.4.27
  • Launch command: openclaw gateway

Repro steps

  1. Install/upgrade to [email protected]
  2. Start gateway with a config that handles Telegram sessions (embedded agent path enabled)
  3. Send a message to trigger a session
  4. Observe lane/session errors:
    • lane task error ... ERR_PACKAGE_PATH_NOT_EXPORTED ... ./oauth
    • Embedded agent failed before reply
    • session-init browser cleanup unavailable

Expected behavior

No package export error; session should continue normally.

Actual behavior

Session lanes fail with ERR_PACKAGE_PATH_NOT_EXPORTED, then fallback model is used or reply fails.

Additional findings

  • @mariozechner/pi-ai/package.json in installed tree includes:
    • exports[./oauth].import = ./dist/oauth.js
  • ESM import works:
    • import('@mariozechner/pi-ai/oauth') -> success
  • CJS require fails with same error:
    • require('@mariozechner/pi-ai/oauth') -> ERR_PACKAGE_PATH_NOT_EXPORTED

This suggests a CJS require() path is being hit somewhere in runtime after upgrade, while ./oauth is only exported for import.

Temporary workarounds

  • Downgrade to previous OpenClaw version (e.g. 2026.4.26)
  • Local hotfix in installed @mariozechner/pi-ai/package.json by adding default (or require) to exports[./oauth]

Request

Could maintainers confirm and patch one of:

  1. Ensure runtime never resolves @mariozechner/pi-ai/oauth through CJS require, or
  2. Add default/require export for ./oauth in the dependency path used by OpenClaw.

extent analysis

TL;DR

The most likely fix is to update the @mariozechner/pi-ai/package.json to include a default or require export for the ./oauth path to ensure compatibility with both ESM and CJS imports.

Guidance

  • Verify that the issue is indeed caused by the openclaw upgrade by downgrading to a previous version (e.g., 2026.4.26) and checking if the error persists.
  • Check the @mariozechner/pi-ai/package.json file in the installed tree to confirm that it only includes an import export for ./oauth and not a default or require export.
  • Consider applying a local hotfix by adding a default or require export for ./oauth in the @mariozechner/pi-ai/package.json file as a temporary workaround.
  • If possible, test the ESM import (import('@mariozechner/pi-ai/oauth')) and CJS require (require('@mariozechner/pi-ai/oauth')) in a controlled environment to confirm the import method being used by openclaw.

Example

No code snippet is provided as the issue is related to package configuration and import methods.

Notes

The issue seems to be related to the change in import methods between ESM and CJS, and the @mariozechner/pi-ai package not being properly configured to handle both. The provided temporary workarounds suggest that the issue can be resolved by either downgrading openclaw or updating the package configuration.

Recommendation

Apply the temporary workaround by adding a default or require export for ./oauth in the @mariozechner/pi-ai/package.json file, as this seems to be the most straightforward solution to ensure compatibility with both ESM and CJS imports.

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…

FAQ

Expected behavior

No package export error; session should continue normally.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Regression after 2026.4.27: ERR_PACKAGE_PATH_NOT_EXPORTED for @mariozechner/pi-ai/oauth [1 comments, 2 participants]