-
-
Notifications
You must be signed in to change notification settings - Fork 354
Open
Description
Describe the bug
Surprised this has not been reported yet. I've used Orama previously with Vite as a bundler without issues.
I'm now setting up an Expo web/native project, and see these warnings:
WARN Require cycle: ../../../node_modules/@orama/orama/dist/esm/errors.js -> ../../../node_modules/@orama/orama/dist/esm/utils.js -> ../../../node_modules/@orama/orama/dist/esm/errors.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
WARN Require cycle: ../../../node_modules/@orama/orama/dist/esm/methods/search.js -> ../../../node_modules/@orama/orama/dist/esm/methods/search-fulltext.js -> ../../../node_modules/@orama/orama/dist/esm/methods/search.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
WARN Require cycle: ../../../node_modules/@orama/orama/dist/esm/methods/search.js -> ../../../node_modules/@orama/orama/dist/esm/methods/search-hybrid.js -> ../../../node_modules/@orama/orama/dist/esm/methods/search.js
These are not benign, it actually resulted in a fetchDocuments is not a function
runtime error when calling the search
function.
At the moment, the only workaround I can think of would be for users to bundle the entirety of the Orama source into a single file via esbuild or similar.
To Reproduce
npx create-expo-app@latest test
cd test && npm i @orama/orama
npm run ios
Expected behavior
No require cycles – shared dependencies should be extracted to a third file to break the circularity.
Environment Info
N/A
Affected areas
Search
Additional context
Edit: Seems as though this is not the first time: #181
Metadata
Metadata
Assignees
Labels
No labels