-
Notifications
You must be signed in to change notification settings - Fork 87
Description
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
- Create a new project:
npm init -y - Install:
npm install agentic-flow@alpha - 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:
- Ensure agentdb publishes
dist/controllers/index.js - Or update SharedMemoryPool.ts import to use the correct path (
dist/src/controllers/index.js) - 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.