[plugins] memos-local-openclaw-plugin failed to load from .../dist/index.js:
ReferenceError: exports is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension
and package.json contains "type": "module". To treat it as a CommonJS script,
rename it to use the '.cjs' file extension.
问题描述
@memtensor/memos-lite-openclaw-pluginv0.2.3 安装后在 OpenClaw 2026.5.7 上加载失败。错误信息
原因分析
package.json中声明了"type": "module"(ES Module 模式)dist/index.js使用的是 CommonJS 语法:exports.initPlugin = initPlugin+require()package.json的type字段判断模块格式,导致加载失败环境
尝试过的修复
dist/index.js→dist/index.cjs,同时更新openclaw.plugin.json指向./dist/index.cjsbetter-sqlite3在安装时已成功编译建议修复方向
package.json中移除"type": "module",或dist/index.js从 CommonJSexports重构为 ESMexport语法感谢!期待修复 🙏