Skip to content

Update Algolia SDK to version 5#243

Open
dreitzner wants to merge 14 commits into
nuxt-modules:mainfrom
dreitzner:update-algolia-sdk
Open

Update Algolia SDK to version 5#243
dreitzner wants to merge 14 commits into
nuxt-modules:mainfrom
dreitzner:update-algolia-sdk

Conversation

@dreitzner

@dreitzner dreitzner commented May 15, 2026

Copy link
Copy Markdown

Because of the sdk deprecation the algolia sdk needs to be upgraded.

Types of changes

  • 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

Update to latest Algolia SDK following https://www.algolia.com/doc/libraries/sdk/upgrade/javascript

As the new LiteClient is no longer compatible with the full search client, they will be loaded in parallel, if lite: false is set.

resolves issue #242

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

@dreitzner

Copy link
Copy Markdown
Author

@Baroshem I think my changes are ready for review 😊

Let me know if more needs to be done

@Baroshem

Copy link
Copy Markdown
Collaborator

Hey Buddy,

Thanks for creating this PR! I will review it, test it and release soon! :)

@Baroshem

Baroshem commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Hey @dreitzner sorry for no contact but I was on a few events last few weeks.

I checked the PR and overall the code looks good but we cannot merge it yet as there are some issues with the build/prepack/running locally dev environment.

When I try to run it locally I see this:

 ERROR  [request error] [unhandled] [GET] http://localhost:3000/__nuxt_error?error=true&url=%2F&statusCode=500&statusMessage=Server+Error&message=The+requested+module+%27@algolia%2Frequester-node-http%27+does+not+provide+an+export+named+%27createHttpRequester%27&stack=The+requested+module+%27@algolia%2Frequester-node-http%27+does+not+provide+an+export+named+%27createHttpRequester%27%0Aat+%2FUsers%2Fjakub%2FCoding%2Falgolia%2Fnode_modules%2Falgoliasearch%2Flite%2Fbuilds%2Fnode.ts:8:undefined:undefined:undefined)%0Aat+%23asyncInstantiate+(node:internal%2Fmodules%2Fesm%2Fmodule_job:319:21)%0Aat+process.processTicksAndRejections+(node:internal%2Fprocess%2Ftask_queues:103:5)%0Aat+async+ModuleJob.run+(node:internal%2Fmodules%2Fesm%2Fmodule_job:422:5)%0Aat+async+onImport.tracePromise.__proto__+(node:internal%2Fmodules%2Fesm%2Floader:661:26)%0Aat+async+ViteNodeRunner.interopedImport+(%2FUsers%2Fjakub%2FCoding%2Falgolia%2Fnode_modules%2Fvite-node%2Fdist%2Fclient.mjs:426:28)%0Aat+async+ViteNodeRunner.directRequest+(%2FUsers%2Fjakub%2FCoding%2Falgolia%2Fnode_modules%2Fvite-node%2Fdist%2Fclient.mjs:280:24)%0Aat+async+ViteNodeRunner.cachedRequest+(%2FUsers%2Fjakub%2FCoding%2Falgolia%2Fnode_modules%2Fvite-node%2Fdist%2Fclient.mjs:206:14)%0Aat+async+ViteNodeRunner.dependencyRequest+(%2FUsers%2Fjakub%2FCoding%2Falgolia%2Fnode_modules%2Fvite-node%2Fdist%2Fclient.mjs:259:12)%0Aat+async+%2FUsers%2Fjakub%2FCoding%2Falgolia%2Fsrc%2Fruntime%2Fplugin.ts:1:387)%0Aat+async+ViteNodeRunner.runModule+(%2FUsers%2Fjakub%2FCoding%2Falgolia%2Fnode_modules%2Fvite-node%2Fdist%2Fclient.mjs:401:5)

 
ℹ Error: The requested module '@algolia/requester-node-http' does not provide an export named 'createHttpRequester'

 ⁃ (node_modules/algoliasearch/lite/builds/node.ts:8:undefined:undefined:undefined:undefined:undefined:undefined:undefined)
 ⁃ at #asyncInstantiate (node:internal/modules/esm/module_job:319:21)
 ⁃ at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
 ⁃ at async ModuleJob.run (node:internal/modules/esm/module_job:422:5)
 ⁃ at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:661:26)
 ⁃ at async ViteNodeRunner.interopedImport (node_modules/vite-node/dist/client.mjs:426:28)
 ⁃ at async ViteNodeRunner.directRequest (node_modules/vite-node/dist/client.mjs:280:24)
 ⁃ at async ViteNodeRunner.cachedRequest (node_modules/vite-node/dist/client.mjs:206:14)
 ⁃ at async ViteNodeRunner.dependencyRequest (node_modules/vite-node/dist/client.mjs:259:12)
 ⁃ (async src/runtime/plugin.ts:1:387)
 ⁃ at async ViteNodeRunner.runModule (node_modules/vite-node/dist/client.mjs:401:5)

[CAUSE]
SyntaxError {
  stack: "The requested module '@algolia/requester-node-http' does not provide an export named 'createHttpRequester'\n" +
  'at ./node_modules/algoliasearch/lite/builds/node.ts:8:undefined:undefined:undefined:undefined:undefined)\n' +
  '    at #asyncInstantiate (node:internal/modules/esm/module_job:319:21)\n' +
  '    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n' +
  '    at async ModuleJob.run (node:internal/modules/esm/module_job:422:5)\n' +
  '    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:661:26)\n' +
  'at async ViteNodeRunner.interopedImport (./node_modules/vite-node/dist/client.mjs:426:28)\n' +
  'at async ViteNodeRunner.directRequest (./node_modules/vite-node/dist/client.mjs:280:24)\n' +
  'at async ViteNodeRunner.cachedRequest (./node_modules/vite-node/dist/client.mjs:206:14)\n' +
  'at async ViteNodeRunner.dependencyRequest (./node_modules/vite-node/dist/client'... 187 more characters,
  message: "The requested module '@algolia/requester-node-http' does not provide 
  an export named 'createHttpRequester'",
}

Trying to yarn dev:prepare shows following:

Jakub:algolia jakub$ yarn dev:prepare
yarn run v1.22.4
$ nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground

 ERROR  The requested module 'glob' does not provide an export named 'default'                                                                                               11:16:04 AM

  import glob from 'glob';
  ^^^^
  SyntaxError: The requested module 'glob' does not provide an export named 'default'
  at #asyncInstantiate (node:internal/modules/esm/module_job:319:21)
  at async ModuleJob.run (node:internal/modules/esm/module_job:422:5)
  at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:661:26)
  at async Object.run (node_modules/@nuxt/module-builder/dist/chunks/build.mjs:42:23)
  at async runCommand (node_modules/citty/dist/index.mjs:316:16)
  at async runCommand (node_modules/citty/dist/index.mjs:307:11)
  at async runMain (node_modules/citty/dist/index.mjs:445:7) 

And the same for prepack.

Could you please check it out? :)

@dreitzner

dreitzner commented Jul 10, 2026

Copy link
Copy Markdown
Author

@Baroshem can you give me more information?

I'm running with

  • WSL
  • node 24
  • yarn (as specified in the package.json)

My yarn dev:prepare:

domenikreitzner@77RYJS3:~/projects/open-source/algolia$ yarn dev:prepare
yarn run v1.22.22
$ nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
ℹ Stubbing algolia                                                                                                                                                 8:24:13 AM
ℹ Cleaning dist directory: ./dist                                                                                                                                  8:24:13 AM
│
◆  Types generated in .nuxt.

 ERROR  (node:30080) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.                                                                              8:24:16 AM
(Use node --trace-deprecation ... to show where the warning was created)

✔ Types generated in playground/.nuxt                                                                                                                        nuxi  8:24:18 AM
Done in 5.66s.

Dev server also starts up nicely.

I had to do a small fix for the prepack command, but that should work now as well.

domenikreitzner@77RYJS3:~/projects/open-source/algolia$ yarn prepack
yarn run v1.22.22
$ nuxt-module-build build
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
ℹ Building algolia                                                                                                                                                 8:49:35 AM
ℹ Cleaning dist directory: ./dist                                                                                                                                  8:49:35 AM
src/runtime/components/AlgoliaDocSearch.vue(7,25): error TS2742: The inferred type of '__VLS_export' cannot be named without a reference to '@algolia/autocomplete-shared/node_modules/algoliasearch/lite'. This is likely not portable. A type annotation is necessary.

✔ Build succeeded for algolia                                                                                                                                      8:49:49 AM
  dist/runtime (total size: 58.5 kB)                                                                                                                                8:49:49 AM
  └─ dist/runtime/plugin.d.ts (43.2 kB)
  └─ dist/runtime/composables/useAsyncAlgoliaSearch.js (874 B)
  └─ dist/runtime/plugin.js (1.2 kB)
  └─ dist/runtime/components/AlgoliaDocSearch.vue.d.ts
  └─ dist/runtime/components/AlgoliaDocSearch.d.vue.ts
  └─ dist/runtime/composables/useAlgoliaRef.d.ts (51 B)
  └─ dist/runtime/server/api/storyblok.d.ts (207 B)
  └─ dist/runtime/composables/useAlgoliaRef.js (165 B)
  └─ dist/runtime/composables/useAlgoliaRecommend.js (721 B)
  └─ dist/runtime/composables/useAlgoliaSearch.d.ts (625 B)
  └─ dist/runtime/composables/useAlgoliaSearch.js (1.21 kB)
  └─ dist/runtime/composables/useAsyncAlgoliaSearch.d.ts (398 B)
  └─ dist/runtime/components/AlgoliaDocSearch.vue (6.77 kB)
  └─ dist/runtime/composables/useAlgoliaFacetedSearch.js (722 B)
  └─ dist/runtime/composables/useAlgoliaFacetedSearch.d.ts (758 B)
  └─ dist/runtime/composables/useAlgoliaRecommend.d.ts (609 B)
  └─ dist/runtime/server/api/storyblok.js (959 B)
  dist/module.mjs (total size: 7.5 kB, chunk size: 7.5 kB, exports: InstantSearchThemes, default)                                                                   8:49:49 AM

Σ Total dist size (byte size): 85.5 kB
                                                                                                                                                                    8:49:49 AM
Done in 16.78s.

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

Successfully merging this pull request may close these issues.

2 participants