Skip to content

Could not find a declaration file for module '@babycommando/entity-db' #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hbcondo opened this issue May 7, 2025 · 4 comments
Open

Comments

@hbcondo
Copy link

hbcondo commented May 7, 2025

Thanks for creating entity-db! I'm anxious to try it out but keep running into this issue when following the readme:

  1. npm install @babycommando/entity-db
  2. import { EntityDB } from "@babycommando/entity-db
[{
	"resource": "/myproj/db.ts",
	"owner": "typescript",
	"code": "7016",
	"severity": 8,
	"message": "Could not find a declaration file for module '@babycommando/entity-db'. '/myproj/node_modules/@babycommando/entity-db/src/index.js' implicitly has an 'any' type.\n  Try `npm i --save-dev @types/babycommando__entity-db` if it exists or add a new declaration (.d.ts) file containing `declare module '@babycommando/entity-db';`",
	"source": "ts",
	"startLineNumber": 1,
	"startColumn": 20,
	"endLineNumber": 1,
	"endColumn": 45
}]
@babycommando
Copy link
Owner

Hey @hbcondo my bad! Forgot to add the types for typescript.

Fixed now, try reinstalling the lib and it should work, tell me how it went.

npm uninstall @babycommando/entity-db
npm install @babycommando/entity-db

if you encounter any caching issues then:

rm -rf node_modules package-lock.json
npm cache clean --force
npm install

@hbcondo
Copy link
Author

hbcondo commented May 8, 2025

Thanks, @babycommando. Adding the types resolved the import error but now I get an error when Initializing the VectorDB instance:

@babycommando_entity-db.js?v=21b037e6:18234 Uncaught TypeError: Cannot convert undefined or null to object
    at Object.keys (<anonymous>)
    at isEmpty (@babycommando_entity-db.js?v=21b037e6:18234:17)
    at @babycommando_entity-db.js?v=21b037e6:18198:21

@babycommando babycommando reopened this May 8, 2025
@babycommando
Copy link
Owner

hey @hbcondo I tested here and its everything working fine.

Can you share your code so I can run? Also can you specify what evironment you are on? (nextjs, react, pure html, etc.)

@hbcondo
Copy link
Author

hbcondo commented May 10, 2025

I installed entity-db in a vanilla react-js project via vite. It looks like the error originates from here:

const FS_AVAILABLE = !isEmpty(fs); // check if file system is available
const PATH_AVAILABLE = !isEmpty(path); // check if path is available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants