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

Error: export 'Document' (imported as 'Document') was not found in 'flexsearch' (possible exports: default) #438

Open
mirkoacadevmy opened this issue May 10, 2024 · 2 comments

Comments

@mirkoacadevmy
Copy link

When I’m using flexsearch in my project and the project uses typescript too. I wrote the code below, with no complaints from IDE:

import { Document } from 'flexsearch';

this.index = new Document<Document, true>({
      document: {
        id: 'id',
        tag: 'type',
        index: Array.from(indexes),
        store: true
      }
    });

but when I compile the code I receive the following error:

Error: export 'Document' (imported as 'Document') was not found in 'flexsearch' (possible exports: default)

A similar error occurred also to this guy, where he explains the cause and how to resolve: Flexsearch Document Error

The solution works but with that all TypeScript types are broken, because replaced with any

@luwes
Copy link

luwes commented Jun 28, 2024

I got the same error today.

@zero1zero
Copy link

The workaround from the link worked for me but I got the same error. Workaround:

import search from "flexsearch"
const i: search.Index = ...

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

3 participants