Skip to content

v1.1.0-beta.10 release regressed LanceDB loading on macOS/Linux (Dynamic require not supported) #900

Description

@dadi32-collab

Bug Description

The v1.1.0-beta.10 release reintroduces a CommonJS require() call inside an ESM module, breaking memory-pro stats, memory-pro search, and any memory_recall/store/forget tool usage on macOS/Linux.

Steps to Reproduce

  1. Install memory-lancedb-pro@1.1.0-beta.10 via OpenClaw 2026.6.8 on macOS 25.5 (arm64)
  2. Configure with any working embedding provider (e.g. OpenAI-compatible Ollama bge-m3)
  3. Run openclaw memory-pro stats (or any other memory-pro command)
  4. Plugin loads fine but every command fails:
Failed to get statistics: Error: Dynamic require of "@lancedb/lancedb" is not supported

Root Cause

In dist/src/store.js (compiled from src/store.ts), loadLanceDB() uses:

lancedbImportPromise = Promise.resolve(require("@lancedb/lancedb"));

The misleading source comment claims this is needed "to avoid ESM URL scheme issues on Windows", but memory-lancedb-pro is an ESM module ("type": "module" in package.json), and ESM modules cannot use CommonJS require() anywhere — including macOS/Linux.

Version Comparison

Version loadLanceDB() Implementation macOS/Linux
v1.0.16 lancedbImportPromise = import("@lancedb/lancedb"); ✅ works
v1.1.0-beta.10 lancedbImportPromise = Promise.resolve(require("@lancedb/lancedb")); ❌ broken
master (commit 79fe383) lancedbImportPromise = Promise.resolve(requireCJS("@lancedb/lancedb")); (createRequire-based) ✅ works

Related Issues

This is closely related to issue #890 ("Committed dist is stale relative to src: shipped builds miss the process.report.excludeNetwork hang guard") — both stem from the same root cause: v1.1.0-beta.10 was tagged without rebuilding dist from the current main branch src.

Temporary Workaround

Patch the three compiled files in-place (will be overwritten on next plugin reinstall/upgrade):

- lancedbImportPromise = Promise.resolve(__require("@lancedb/lancedb"));
+ lancedbImportPromise = import("@lancedb/lancedb");

Files affected:

  • dist/src/store.js (line ~22)
  • dist/cli.js (line ~1429)
  • dist/index.js (line ~3183)

Suggested Fix

Rebuild dist from current master and tag a v1.1.0 (non-beta) release, or cherry-pick commit 79fe383 ("fix(store): use createRequire for cross-platform LanceDB loading") into a new v1.1.0-beta.11 patch release.

Environment

  • OpenClaw 2026.6.8 (844f405)
  • Node.js v22.22.1
  • macOS Darwin 25.5.0 (arm64)
  • @lancedb/lancedb@^0.26.2
  • Plugin version: 1.1.0-beta.10

Impact

  • Users who installed via OpenClaw marketplace / ClawHub cannot use the plugin at all without manual patching
  • The macOS/Linux user base (most OpenClaw users) is fully blocked
  • Documentation / blog references to memory-lancedb-pro are now misleading until fixed

Thanks for the great plugin — happy to test any patch release.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions