-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Description
The published agentdb@2.0.0-alpha.2.7 package has incorrect export paths in package.json. All paths reference ./dist/ but the actual compiled files are in ./dist/src/.
Steps to Reproduce
npm install agentdb@2.0.0-alpha.2.7
node --input-type=module -e "import * as agentdb from 'agentdb'; console.log(agentdb);"Error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../agentdb/dist/index.js'
Root Cause
In package.json:
{
"main": "dist/index.js", // ❌ File doesn't exist
"exports": {
".": "./dist/index.js", // ❌ Should be ./dist/src/index.js
"./controllers": "./dist/controllers/index.js" // ❌ Should be ./dist/src/controllers/index.js
}
}Actual file locations:
dist/src/index.js ✅ Exists
dist/src/controllers/ ✅ Exists
dist/index.js ❌ Missing
Suggested Fix
Option A: Update package.json exports to use dist/src/ prefix:
{
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"exports": {
".": "./dist/src/index.js",
"./controllers": "./dist/src/controllers/index.js",
"./controllers/CausalMemoryGraph": "./dist/src/controllers/CausalMemoryGraph.js",
"./controllers/ReflexionMemory": "./dist/src/controllers/ReflexionMemory.js",
// ... etc
}
}Option B: Update tsconfig.json to set outDir: "dist" and rootDir: "src" so files compile directly to dist/ instead of dist/src/.
Workaround
Using pnpm patch to fix locally:
pnpm patch agentdb@2.0.0-alpha.2.7
# Edit package.json to fix paths
pnpm patch-commit <patch-dir>Environment
- Node.js: v22.x
- agentdb: 2.0.0-alpha.2.7
- Package manager: pnpm
Additional Context
This affects all exports including:
- Main entry point (
agentdb) - Controller subpath exports (
agentdb/controllers/*) - CLI binary path
Thanks for the great work on v2! Just needs this path fix to work. 🙏
Metadata
Metadata
Assignees
Labels
No labels