[x] Bug fix (a non-breaking change which fixes an issue)
[ ] New feature (a non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
useAlgoliaRef exports the esm/browser version of the algoliasearch client.
The browser version uses the browserXHRRequester, which doesn't work in node environments, while the non-esm package works both in client and in server environments because it automatically switches XMLHttpRequester and browserXHRRequester depending on the environment it's called within, and that's why algoliaclient works but useAlgoliaRef does not when passing it to swiftsearch.
Proposed fix is to ubiquitously use the fetch requester, which is a better "futuristic" (more contemporary) approach.
If this works for you I'm going to implement swiftsearch integration after.
Fixes https://github.com/atoms-studio/nuxt-swiftsearch/issues/1
Types of changes
Description
useAlgoliaRef exports the esm/browser version of the algoliasearch client. The browser version uses the browserXHRRequester, which doesn't work in node environments, while the non-esm package works both in client and in server environments because it automatically switches XMLHttpRequester and browserXHRRequester depending on the environment it's called within, and that's why algoliaclient works but useAlgoliaRef does not when passing it to swiftsearch.
Proposed fix is to ubiquitously use the fetch requester, which is a better "futuristic" (more contemporary) approach.
If this works for you I'm going to implement swiftsearch integration after.