Skip to content

[Bug] agentic-flow@2.0.1-alpha.5 fails to load: bundled agentdb missing dist/controllers/index.js #80

@stuinfla

Description

@stuinfla

Bug Description

agentic-flow@2.0.1-alpha.5 fails to load when imported via require('agentic-flow') due to a missing compiled file in the bundled agentdb dependency.

Error Message

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/path/to/node_modules/agentic-flow/node_modules/agentdb/dist/controllers/index.js' imported from /path/to/node_modules/agentic-flow/dist/memory/SharedMemoryPool.js
    at finalizeResolution (node:internal/modules/esm/resolve:275:11)
    at moduleResolve (node:internal/modules/esm/resolve:932:10)
    at defaultResolve (node:internal/modules/esm/resolve:1056:11)

Root Cause

The bundled agentdb@2.0.0-alpha.2.20 inside node_modules/agentic-flow/node_modules/agentdb/ is missing the dist/controllers/index.js file.

What exists in agentdb/dist/:

agentdb.browser.js
agentdb.browser.js.map
agentdb.browser.min.js
agentdb.browser.min.js.map
agentdb.wasm-loader.js
schemas/
simulation/
src/          <- controllers/ exists here but NOT at dist/controllers/

What agentic-flow expects:

  • dist/controllers/index.js (missing)

The file agentic-flow/dist/memory/SharedMemoryPool.js imports from the bundled agentdb's dist/controllers/index.js, but that path doesn't exist in the published agentdb package.

Environment

  • agentic-flow version: 2.0.1-alpha.5
  • bundled agentdb version: 2.0.0-alpha.2.20
  • Node.js version: v22.13.1
  • OS: macOS (Darwin 25.1.0)

Steps to Reproduce

  1. Create a new project: npm init -y
  2. Install: npm install agentic-flow@alpha
  3. Try to import: node -e "require('agentic-flow')"

Expected Behavior

The package should load without errors.

Actual Behavior

Throws ERR_MODULE_NOT_FOUND for agentdb/dist/controllers/index.js.

Workaround

The CLI (npx agentic-flow --version) works fine. Only programmatic require() fails.

Suggested Fix

Either:

  1. Ensure agentdb publishes dist/controllers/index.js
  2. Or update SharedMemoryPool.ts import to use the correct path (dist/src/controllers/index.js)
  3. Or update agentdb's package.json exports to map the expected path

Additional Context

Installing agentdb@latest separately does not fix the issue because agentic-flow uses its own nested copy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions