openclaw - 💡(How to fix) Fix openclaw-weixin plugin (2.4.3) silently fails to load: ESM/CJS compatibility issue on Windows [2 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#83997Fetched 2026-05-20 03:45:30
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
1
Timeline (top)
commented ×2labeled ×2closed ×1

Error Message

After installing the openclaw-weixin plugin and enabling it via plugins.entries.openclaw-weixin.enabled: true + plugins.allow: ["openclaw-weixin"], the plugin is discovered at startup but silently fails to load. It never appears in the active plugin list, and openclaw channels login --channel openclaw-weixin returns Error: Unsupported channel: openclaw-weixin. No error is logged at any point during plugin loading. When the Gateway attempts to load this via require(), Node.js either silently fails or the dynamic import path throws an unhandled exception that the plugin loader swallows. 2. Host side: Use dynamic import() (async ESM import) instead of require() when loading non-bundled plugins, with proper error surfacing 3. Error surfacing: At minimum, log a clear error when a discovered plugin fails to load, rather than silently skipping it

Root Cause

The plugin package declares "type": "module" (pure ESM), while the OpenClaw Gateway runs in a CommonJS environment. The dist/index.js uses top-level import statements:

import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
import { weixinPlugin } from "./src/channel.js";

When the Gateway attempts to load this via require(), Node.js either silently fails or the dynamic import path throws an unhandled exception that the plugin loader swallows.

Code Example

[plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: openclaw-weixin (C:\Users\pc2025\.openclaw\npm\node_modules\@tencent-weixin\openclaw-weixin\dist\index.js)

---

[gateway] http server listening (7 plugins: browser, device-pair, file-transfer, memory-core, phone-control, slack, talk-voice; 2.4s)

---

import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
import { weixinPlugin } from "./src/channel.js";
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw version: 2026.5.7
  • Plugin: @tencent-weixin/openclaw-weixin 2.4.3
  • OS: Windows 11 (Node.js v24.13.0)
  • Shell: PowerShell

Problem

After installing the openclaw-weixin plugin and enabling it via plugins.entries.openclaw-weixin.enabled: true + plugins.allow: ["openclaw-weixin"], the plugin is discovered at startup but silently fails to load. It never appears in the active plugin list, and openclaw channels login --channel openclaw-weixin returns Error: Unsupported channel: openclaw-weixin.

Startup log evidence

Gateway logs show the plugin is discovered but never registered:

[plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: openclaw-weixin (C:\Users\pc2025\.openclaw\npm\node_modules\@tencent-weixin\openclaw-weixin\dist\index.js)

But the final startup line only lists 7 bundled plugins with no weixin:

[gateway] http server listening (7 plugins: browser, device-pair, file-transfer, memory-core, phone-control, slack, talk-voice; 2.4s)

No error is logged at any point during plugin loading.

Root cause analysis

The plugin package declares "type": "module" (pure ESM), while the OpenClaw Gateway runs in a CommonJS environment. The dist/index.js uses top-level import statements:

import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
import { weixinPlugin } from "./src/channel.js";

When the Gateway attempts to load this via require(), Node.js either silently fails or the dynamic import path throws an unhandled exception that the plugin loader swallows.

Steps to reproduce

  1. openclaw plugins install "@tencent-weixin/openclaw-weixin"
  2. Edit openclaw.json to add plugins.entries.openclaw-weixin.enabled: true and plugins.allow: ["openclaw-weixin"]
  3. openclaw gateway restart
  4. Check openclaw channels status — weixin is absent
  5. Run openclaw channels login --channel openclaw-weixin — returns Unsupported channel

Expected behavior

Plugin loads successfully, openclaw-weixin appears in channel list, QR login works.

Possible fixes

  1. Plugin side: Ship a CJS-compatible build (dist/index.cjs) or use "exports" field with dual CJS/ESM support
  2. Host side: Use dynamic import() (async ESM import) instead of require() when loading non-bundled plugins, with proper error surfacing
  3. Error surfacing: At minimum, log a clear error when a discovered plugin fails to load, rather than silently skipping it

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

Plugin loads successfully, openclaw-weixin appears in channel list, QR login works.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING