Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: TypeError: Cannot read properties of undefined (reading 'transporter') #1549

Closed
sefai opened this issue Sep 6, 2024 · 8 comments · Fixed by algolia/instantsearch#6352 or algolia/api-clients-automation#3682
Labels

Comments

@sefai
Copy link

sefai commented Sep 6, 2024

Description

I've updated algoliasearch to 5.3.0 and other packages as well, below is the error I get.

Client

Search

Version

"algoliasearch": "^5.3.0", "instantsearch.js": "^4.74.0","react-instantsearch": "^7.13.0","@algolia/requester-fetch": "^5.3.0"

Relevant log output

<ref *1> TypeError: Cannot read properties of undefined (reading 'transporter')
    at search (file:///algolia_remix_project/node_modules/algoliasearch/dist/lite/builds/node.js:243:21)
    at file:///algolia_remix_project/node_modules/instantsearch.js/es/lib/utils/hydrateSearchClient.js:71:27
    at Object.get (file:///algolia_remix_project/node_modules/@algolia/client-common/dist/common.esm.js:185:21)
    at client.search (file:///algolia_remix_project/node_modules/instantsearch.js/es/lib/utils/hydrateSearchClient.js:67:48)
    at Object.search (file:///algolia_remix_project/node_modules/instantsearch.js/es/lib/server.js:26:21)
    at AlgoliaSearchHelper._search (/algolia_remix_project/node_modules/algoliasearch-helper/src/algoliasearch.helper.js:1565:8)
    at AlgoliaSearchHelper.searchOnlyWithDerivedHelpers (/algolia_remix_project/node_modules/algoliasearch-helper/src/algoliasearch.helper.js:167:8)
    at waitForResults (file:///algolia_remix_project/node_modules/instantsearch.js/es/lib/server.js:29:37)
    at file:///algolia_remix_project/node_modules/react-instantsearch-core/dist/es/server/getServerState.js:85:12
    at async eval (/algolia_remix_project/app/routes/_test.$parent.$category.tsx:78:23)
    at async Object.callRouteLoader (/algolia_remix_project/node_modules/@remix-run/server-runtime/dist/data.js:59:16)
    at async /algolia_remix_project/node_modules/@remix-run/router/dist/router.cjs.js:4683:21
    at async callLoaderOrAction (/algolia_remix_project/node_modules/@remix-run/router/dist/router.cjs.js:4748:16)
    at async Promise.all (index 2)
    at async callDataStrategyImpl (/algolia_remix_project/node_modules/@remix-run/router/dist/router.cjs.js:4623:17)
    at async callDataStrategy (/algolia_remix_project/node_modules/@remix-run/router/dist/router.cjs.js:4111:19)
    at async loadRouteData (/algolia_remix_project/node_modules/@remix-run/router/dist/router.cjs.js:4086:19)
    at async queryImpl (/algolia_remix_project/node_modules/@remix-run/router/dist/router.cjs.js:3931:20)
    at async Object.query (/algolia_remix_project/node_modules/@remix-run/router/dist/router.cjs.js:3824:18)
    at async handleDocumentRequest (/algolia_remix_project/node_modules/@remix-run/server-runtime/dist/server.js:267:15)
    at async requestHandler (/algolia_remix_project/node_modules/@remix-run/server-runtime/dist/server.js:160:18)
    at async /algolia_remix_project/node_modules/@remix-run/dev/dist/vite/cloudflare-proxy-plugin.js:70:25 {
  error: [Circular *1]
}
@sefai sefai added the bug label Sep 6, 2024
@coyotefather
Copy link

coyotefather commented Sep 7, 2024

I get this as well; I do not get it with 4.24.0.

"next": "^14.2.8",
"react": "^18.3.1",
"react-instantsearch": "^7.13.0",
"react-instantsearch-nextjs": "^0.3.10",

@Haroenv
Copy link
Contributor

Haroenv commented Sep 9, 2024

Seems like you might be hitting different cases. Do you have a reproduction available with which code and what scenario this throws?

@sefai
Copy link
Author

sefai commented Sep 9, 2024

Hello @Haroenv,

I don't think this needs a reproduction, if you update "algoliasearch" to "5.3.0" in SSR example with Remix or SSR example with Next.js you will see the error.

Regards,

@juan-calle
Copy link

Hi,
I can confirm this issue is also happening on

"algoliasearch": "^5.2.5"

working fine on

"algoliasearch": "5.1.1",

@kamami
Copy link

kamami commented Sep 9, 2024

Same issue with "algoliasearch": "^5.3.0"

@Haroenv
Copy link
Contributor

Haroenv commented Sep 9, 2024

I can reproduce and am looking into the solution, of course in the mean time don't hesitate to use v4 or 5.1.1

@coyotefather
Copy link

With my NextJS app I get a different error with 5.1.1.

TypeError: (0 , algoliasearch__WEBPACK_IMPORTED_MODULE_1__.default) is not a function

This might be something with my particular app or setup, though.

@coyotefather
Copy link

Actually, the above error was because of how I was importing algoliasearch in the component. Once I fixed that I received the original error again with 5.1.1. Maybe this is specific to react-instantsearch-nextjs since that is still experimental.

Haroenv added a commit to algolia/instantsearch that referenced this issue Sep 9, 2024
Haroenv added a commit to algolia/instantsearch that referenced this issue Sep 10, 2024
* fix(client): ensure client.search is bound

fixes #6350
fixes algolia/algoliasearch-client-javascript#1549
possibly also solves #6348, to investigate afterwards

* fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants