openclaw - ✅(Solved) Fix [Bug]: [AI-Discovered] Feishu channel fails to start on Windows - ESM module loader error [2 pull requests, 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#49489Fetched 2026-04-08 00:54:47
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
cross-referenced ×2labeled ×2commented ×1referenced ×1

On Windows, Feishu channel crashes on startup with ESM module loader error: absolute paths (g:...) not supported, requires file:// URLs

Error Message

On Windows, Feishu channel crashes on startup with ESM module loader error: absolute paths (g:...) not supported, requires file:// URLs 4. Feishu channels fail to start with ESM module loader error All Feishu channels fail to start with error: Error log from gateway/channels/feishu:

  • Error occurs in OpenClaw core code (gateway/channels/feishu), not in openclaw-lark plugin

Root Cause

On Windows, Feishu channel crashes on startup with ESM module loader error: absolute paths (g:...) not supported, requires file:// URLs

Fix Action

Fix / Workaround

  • Error occurs in OpenClaw core code (gateway/channels/feishu), not in openclaw-lark plugin
  • WebChat channel works fine on same system
  • Tried workarounds: disabled plugin, reinstalled plugin, removed skills reference, updated npm - all failed
  • Discovered by AI assistant (Taishi) during system health check

PR fix notes

PR #49658: fix(feishu): convert absolute paths to file:// URLs for ESM imports on Windows

Description (problem / solution / changelog)

Summary

  • Convert dynamic import() calls in the Feishu extension to use new URL(specifier, import.meta.url).href, ensuring the resolved import URL always uses the file:// scheme on Windows.
  • On Windows, Node.js ESM loader rejects absolute paths (e.g. g:\...) passed to import() because the drive letter is interpreted as a URL scheme. Resolving relative specifiers against import.meta.url produces proper file:// URLs that work cross-platform.
  • Affects two dynamic imports in extensions/feishu/src/channel.ts: the lazy channel runtime loader and the gateway startAccount monitor import.

Fixes #49489

Note

Other extensions (matrix, msteams, telegram, zalouser, bluebubbles, googlechat, tlon, zalo, imessage) have the same import("./...") pattern in their channel.ts files. Those should be updated in a follow-up for consistency, though this PR focuses on the Feishu extension as reported in the issue.

Test plan

  • All 43 Feishu test files pass (461 tests)
  • Verify on Windows that the Feishu channel starts without ESM loader errors

🤖 Generated with Claude Code

Changed files

  • extensions/feishu/src/channel.ts (modified, +4/-2)

PR #43043: fix(channels): resolve log file path for cross-date Gateway runs

Description (problem / solution / changelog)

Summary

Fixes #42875

When Gateway runs across date boundaries, the log file is created based on the startup date (e.g., openclaw-2026-03-10.log). However, the CLI command openclaw channels logs was using getResolvedLoggerSettings().file which returns the current date'''s log file (e.g., openclaw-2026-03-11.log), causing users to see empty or stale logs.

Changes

Added a resolveLogFile() function to src/commands/channels/logs.ts that:

  1. Returns the configured file if it exists
  2. For rolling log files (openclaw-YYYY-MM-DD.log), finds the most recent log file by mtime in the same directory
  3. Falls back to the configured file if no rolling logs are found

This mirrors the behavior already implemented in the Gateway'''s logs.tail handler (src/gateway/server-methods/logs.ts), ensuring consistent log file resolution across CLI and Gateway.

Testing

Added comprehensive tests in src/commands/channels/logs.test.ts covering:

  • Resolving to most recent log file when current date file does not exist
  • Using current date file when it exists
  • Selecting most recent file by mtime when multiple exist
  • Channel filtering
  • Empty log directory handling
  • Non-rolling log file paths

Checklist

  • Bug fix
  • Tests added
  • Backward compatible
  • No breaking changes

Changed files

  • src/commands/channels/logs.test.ts (added, +216/-0)
  • src/commands/channels/logs.ts (modified, +38/-1)

Code Example

Error log from gateway/channels/feishu:
[zongguan] channel exited: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'g:'
[jinbao] channel exited: ...
[laifu] channel exited: ...
[xiaoliu] channel exited: ...
[ruyi] channel exited: ...
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

On Windows, Feishu channel crashes on startup with ESM module loader error: absolute paths (g:...) not supported, requires file:// URLs

Steps to reproduce

  1. Install OpenClaw on Windows system
  2. Configure Feishu channel (multiple bot accounts)
  3. Start Gateway
  4. Feishu channels fail to start with ESM module loader error
  5. All 5 Feishu bot accounts (wangcai/laifu/jinbao/ruyi/xiaoliu) cannot start

Expected behavior

Feishu channels should start successfully and connect to Feishu API

Actual behavior

All Feishu channels fail to start with error: "Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'g:'"

OpenClaw version

2026.3.14

Operating system

Windows 11

Install method

npm global

Model

N/A (channel startup issue)

Provider / routing chain

N/A (channel startup issue)

Config file / key location

~/.openclaw/openclaw.json (channels.feishu.accounts)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Error log from gateway/channels/feishu:
[zongguan] channel exited: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'g:'
[jinbao] channel exited: ...
[laifu] channel exited: ...
[xiaoliu] channel exited: ...
[ruyi] channel exited: ...

Impact and severity

  • Affected: All Windows users with Feishu channel configured
  • Severity: High (blocks Feishu channel completely)
  • Frequency: 100% reproducible
  • Consequence: All 5 Feishu bot accounts cannot start, Feishu integration completely unusable

Additional information

  • Error occurs in OpenClaw core code (gateway/channels/feishu), not in openclaw-lark plugin
  • WebChat channel works fine on same system
  • Tried workarounds: disabled plugin, reinstalled plugin, removed skills reference, updated npm - all failed
  • Discovered by AI assistant (Taishi) during system health check

extent analysis

Fix Plan

To resolve the ESM module loader error, we need to update the file paths in the Feishu channel configuration to use file:// URLs.

Step-by-Step Solution

  1. Update openclaw.json configuration file: Locate the ~/.openclaw/openclaw.json file and update the channels.feishu.accounts section to use file:// URLs for absolute paths.

{ "channels": { "feishu": { "accounts": [ { "path": "file://g:/path/to/feishu/account1", // ... other account settings ... }, { "path": "file://g:/path/to/feishu/account2", // ... other account settings ... } ] } } }

2. **Verify file paths**:
   Ensure that all file paths in the `openclaw.json` file are correct and point to the intended locations.

### Verification
To verify that the fix worked:
1. Restart the Gateway.
2. Check the Feishu channel logs for any errors.
3. Verify that all 5 Feishu bot accounts can start successfully and connect to the Feishu API.

### Extra Tips
* Make sure to update all absolute paths in the `openclaw.json` file to use `file://` URLs.
* If you encounter any issues after updating the configuration file, try reinstalling the OpenClaw plugin or seeking further assistance from the OpenClaw community.

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

Feishu channels should start successfully and connect to Feishu API

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 - ✅(Solved) Fix [Bug]: [AI-Discovered] Feishu channel fails to start on Windows - ESM module loader error [2 pull requests, 1 comments, 2 participants]