Weixin Plugin Load Failure: Missing openclaw Package in Dependencies
Issue Type
Description
The openclaw-weixin plugin fails to load with a module resolution error. The plugin requires the openclaw package at runtime for its SDK imports, but the package is only listed in devDependencies in package.json, causing it to not be installed during normal plugin installation.
Error Message
Error: Cannot find module 'openclaw/plugin-sdk/channel-config-schema'
Require stack:
- /root/.openclaw/extensions/openclaw-weixin/index.ts
Full error log:
18:54:16 [plugins] openclaw-weixin failed to load from /root/.openclaw/extensions/openclaw-weixin/index.ts:
Error: Cannot find module 'openclaw/plugin-sdk/channel-config-schema'
Require stack:
- /root/.openclaw/extensions/openclaw-weixin/index.ts
Root Cause Analysis
Problematic Code
The plugin's index.ts imports from the openclaw package:
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-entry";
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
package.json Issue
{
"peerDependencies": {
"openclaw": ">=2026.3.22"
},
"devDependencies": {
"openclaw": "2026.3.23"
}
}
The openclaw package is only in devDependencies and peerDependencies. When the plugin is installed:
peerDependencies are not automatically installed (by npm design)
devDependencies are not installed in production/linked scenarios
- The plugin's
node_modules lacks the openclaw package at runtime
Steps to Reproduce
- Install the weixin plugin:
openclaw plugins install openclaw-weixin
- Start the gateway:
openclaw gateway start
- Observe plugin load failure in logs
Expected Behavior
The plugin should load successfully after installation, with all required dependencies available.
Actual Behavior
Plugin fails to load due to missing openclaw module.
Environment
| Component |
Version |
| openclaw |
2026.3.23 |
| Node.js |
v24.14.1 |
| openclaw-weixin |
2.0.1 |
| OS |
Linux (Ubuntu) |
Proposed Solutions
Solution 1: Move openclaw to dependencies (Recommended)
{
"dependencies": {
"openclaw": ">=2026.3.22",
"qrcode-terminal": "0.12.0",
"zod": "4.3.6"
},
"devDependencies": {
"@vitest/coverage-v8": "^3.1.0",
"silk-wasm": "^3.7.1",
"typescript": "^5.8.0",
"vitest": "^3.1.0"
}
}
Pros:
- Dependencies are automatically installed
- Clear indication of runtime requirements
- Standard npm behavior
Cons:
- May cause version conflicts if host openclaw version differs
Solution 2: Document Manual Installation Step
Add to plugin README:
cd ~/.openclaw/extensions/openclaw-weixin
npm install
Pros:
- No code changes required
- User has control over dependency versions
Cons:
- Poor user experience
- Easy to miss during installation
Solution 3: Use Plugin Installation Hook
Create an install.sh script that runs automatically during plugin installation.
Pros:
- Automated installation
- Can handle complex setup
Cons:
- Requires openclaw to support installation hooks
- Security considerations for running scripts
Temporary Workaround
Run the following commands to fix the issue:
cd ~/.openclaw/extensions/openclaw-weixin
npm install
openclaw gateway restart
Or use the provided fix script:
curl -o weixin-fixed.sh <script-url>
chmod +x weixin-fixed.sh
./weixin-fixed.sh
Files Affected
/root/.openclaw/extensions/openclaw-weixin/package.json
/root/.openclaw/extensions/openclaw-weixin/index.ts
Additional Context
This issue affects all plugins that:
- Import from
openclaw/plugin-sdk/* at runtime
- Only list
openclaw in devDependencies or peerDependencies
The same fix should be applied to any similar plugins in the ecosystem.
Checklist
Report Date: 2026-03-25
Reporter: Automated Diagnosis Tool
Weixin Plugin Load Failure: Missing
openclawPackage in DependenciesIssue Type
Description
The
openclaw-weixinplugin fails to load with a module resolution error. The plugin requires theopenclawpackage at runtime for its SDK imports, but the package is only listed indevDependenciesinpackage.json, causing it to not be installed during normal plugin installation.Error Message
Full error log:
Root Cause Analysis
Problematic Code
The plugin's
index.tsimports from theopenclawpackage:package.json Issue
{ "peerDependencies": { "openclaw": ">=2026.3.22" }, "devDependencies": { "openclaw": "2026.3.23" } }The
openclawpackage is only indevDependenciesandpeerDependencies. When the plugin is installed:peerDependenciesare not automatically installed (by npm design)devDependenciesare not installed in production/linked scenariosnode_moduleslacks theopenclawpackage at runtimeSteps to Reproduce
openclaw plugins install openclaw-weixinopenclaw gateway startExpected Behavior
The plugin should load successfully after installation, with all required dependencies available.
Actual Behavior
Plugin fails to load due to missing
openclawmodule.Environment
Proposed Solutions
Solution 1: Move
openclawtodependencies(Recommended){ "dependencies": { "openclaw": ">=2026.3.22", "qrcode-terminal": "0.12.0", "zod": "4.3.6" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.0", "silk-wasm": "^3.7.1", "typescript": "^5.8.0", "vitest": "^3.1.0" } }Pros:
Cons:
Solution 2: Document Manual Installation Step
Add to plugin README:
Pros:
Cons:
Solution 3: Use Plugin Installation Hook
Create an
install.shscript that runs automatically during plugin installation.Pros:
Cons:
Temporary Workaround
Run the following commands to fix the issue:
Or use the provided fix script:
Files Affected
/root/.openclaw/extensions/openclaw-weixin/package.json/root/.openclaw/extensions/openclaw-weixin/index.tsAdditional Context
This issue affects all plugins that:
openclaw/plugin-sdk/*at runtimeopenclawindevDependenciesorpeerDependenciesThe same fix should be applied to any similar plugins in the ecosystem.
Checklist
Report Date: 2026-03-25
Reporter: Automated Diagnosis Tool