algolia / algoliasearch-client-javascript

⚡️ A fully-featured and blazing-fast JavaScript API client to interact with Algolia.
https://www.algolia.com/doc/api-client/javascript/getting-started/
MIT License
1.33k stars 221 forks source link

`methods[key] is not a function` in `4.23.0` #1511

Closed Enngage closed 5 months ago

Enngage commented 5 months ago

Hello,

We started receiving following error when upgrading from 4.22.1 to 4.23.0. No change in code, just the bump up of the npm package.

 TypeError: methods[key] is not a function
    at c:\dev\kontent-ai-learn-fe\.next\server\chunks\node_modules_1a6303._.js:6521:33
    at Array.forEach (<anonymous>)
    at Module.addMethods (c:\dev\kontent-ai-learn-fe\.next\server\chunks\node_modules_1a6303._.js:6519:26)
    at Module.createSearchClient (c:\dev\kontent-ai-learn-fe\.next\server\chunks\node_modules_1a6303._.js:7352:202)
    at Module.algoliasearch (c:\dev\kontent-ai-learn-fe\.next\server\chunks\node_modules_1a6303._.js:8912:25)
    at initAlgoliaSearchClient

Cheers!

shortcuts commented 5 months ago

cc @dhayab the methods listed here https://github.com/algolia/algoliasearch-client-javascript/pull/1509/files#diff-24b438c650124b5fa554b87c388a4381214d893bcd98dae3cf0fb87c7210fbd6R359-R365 should be in a createRecommendClient call not at the root of the search client, because it won't be able to find them

weird that the CI did not caught that

dhayab commented 5 months ago

Thanks for your report @Enngage. We've just released algoliasearch@4.23.1 which includes a fix for the issue you've been experiencing.

shortcuts commented 5 months ago

thanks for tackling this quickly @dhayab