Skip to content
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

Cannot import from @orama/orama/components #657

Open
came opened this issue Mar 6, 2024 · 3 comments
Open

Cannot import from @orama/orama/components #657

came opened this issue Mar 6, 2024 · 3 comments

Comments

@came
Copy link

came commented Mar 6, 2024

Describe the bug

I try to create my own custom Index component as described here: https://docs.oramasearch.com/open-source/internals/components#index. Therefore, I need BM25, index and some other internal types / function. However, I cannot import them as described with

import { index as defaultIndex } from '@orama/orama/components'

Look like it is just not exported anymore :/

BR, Carsten

To Reproduce

Just try to import an you will get the ts error:

Cannot find module '@orama/orama/components' or its corresponding type declarations.ts(2307)
⚠ Error (TS2307) |
Cannot find module
or its corresponding type declarations.

Expected behavior

I would expect to import from '@orama/orama/components'

Environment Info

OS: MacOS Version 14.1.1 (23B81)
Node: v20.0.0
Orama: ^2.0.9

Affected areas

Initialization

Additional context

I can import the defaultIndex like the following, but I cannot get types like this. e.g. Index

import { components } from '@orama/orama'
const { getDocumentIndexId, index: defaultIndex, internalDocumentIDStore, documentsStore} = components

I looked into the source code, but I could not see an error.

@micheleriva
Copy link
Member

@came we're on it

@micheleriva
Copy link
Member

quick question, are you using Orama in TypeScript via ESM or via CJS?

@came
Copy link
Author

came commented Mar 23, 2024

Thank you 👍 I'm importing Orama as ESM

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