Open gabrielsantosblanchet opened 5 months ago
Faced the same issue, got it working by dynamic import (as a workaround).
const searchFunction = async (data) => {
return import("@orama/orama").then(async (module) => {
const searchDB = await module.create({
schema: { ... }
});
// Implement search logic below
})
};
@matijagaspar, @allevo, can we do something to make this less painful?
Describe the bug
when using tsconfig option "module": "Node16", "moduleResolution": "Node16" in a commonJS project orama refuses to import correctly
I'm using these option as per the documentation set in https://www.typescriptlang.org/docs/handbook/modules/reference.html#the-module-compiler-option
To Reproduce
the code will not work, as in it doesn't event compile
Expected behavior
since orama emits cjs file it should just be able to import the correct one
Environment Info
Affected areas
Environment/OS
Additional context
if needed I can provide more details when asked