Skip to content

memory-lancedb plugin: Cannot find module '@lancedb/lancedb' - native dependency resolution broken #13409

@bartoszrychlicki

Description

@bartoszrychlicki

Description

The memory-lancedb plugin fails to load @lancedb/lancedb at runtime, even though the module is properly installed in the extension's node_modules/ directory.

Error

memory-lancedb: failed to load LanceDB. Error: Cannot find module '@lancedb/lancedb'
Require stack:
- /opt/homebrew/lib/node_modules/openclaw/extensions/memory-lancedb/index.ts

Environment

  • OpenClaw: 2026.2.6-3 (85ed6c7)
  • OS: macOS (Apple Silicon, arm64)
  • Node: v23.11.0
  • Install method: npm global (/opt/homebrew/lib/node_modules/openclaw/)

Steps to reproduce

  1. Enable memory-lancedb plugin via openclaw plugins enable memory-lancedb
  2. Configure embedding API key in config
  3. Restart gateway
  4. Try to use memory_store tool

Investigation

The plugin uses a dynamic import('@lancedb/lancedb') in index.ts (line 29), but the error message shows Require stack, suggesting the bundled gateway resolves it differently.

What I tried (all failed):

  1. Installing @lancedb/lancedb + @lancedb/lancedb-darwin-arm64 in the extension's own node_modules/ — not found
  2. Copying deps to OpenClaw's main node_modules/ — breaks other packages (chalk ESM/CJS conflict)
  3. Installing globally via npm install -g — not in require path
  4. openclaw plugins install memory-lancedb — fails with chalk import error

Root cause: The gateway binary bundles extensions and resolves require() from the dist directory, not from the extension's node_modules/. Native dependencies like @lancedb/lancedb (which require platform-specific binaries) cannot be resolved this way.

Expected behavior

Plugins with native dependencies listed in their package.json should have their node_modules/ properly resolved at runtime.

Suggested fix

Either:

  • Add the extension's node_modules to the module resolution path when loading plugins
  • Or provide a openclaw plugins install command that properly installs native deps and wires them up

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions