#546·AiToEarn

aitoearn 插件与 OpenClaw 2026.5.26 的兼容性问题报告

作者: Chang-Tao创建于 2026年5月28日更新于 2026年6月17日
标签bug

Solution 1: Add preload.cjs Create a preload.cjs file in the plugin root directory:

javascript
"use strict";

// Preload entry for aitoearn plugin.
// Node 22+ supports CJS require() of ESM modules.
const _pluginModule = require("./dist/runtime/index.js");

const _default = _pluginModule.default;
const merged = Object.assign({}, _pluginModule);
if (_default && typeof _default === "object") {
  for (const key of Object.keys(_default)) {
    if (!(key in merged)) {
      merged[key] = _default[key];
    }
  }
}

module.exports = merged;

Then modify the package.json:

json
"openclaw": {
  "id": "aitoearn",
  "extensions": [
    "./preload.cjs"
  ],
  ...
}

Also add the logic for creating the openclaw symlink in the preload.cjs (refer to qqbot's scripts/link-sdk-core.cjs) to ensure that the tool-discovery-worker.js can find the openclaw package.

内容来源: yikart/AiToEarn