apollographql / apollographql/apollo-client-integrations

Error: (0 , _apollo_client_integration_nextjs__WEBPACK_IMPORTED_MODULE_2__.registerApolloClient) is not a function

Open
#471 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
556
Forks
53
PR merge metrics
No merged PRs in 30d

Description

![Image](https://github.com/user-attachments/assets/07f62ac4-1ca6-4e63-a27a-7d2f63cae70b)

Of course! Here's the English translation of your corrected and polished message:

We are trying to integrate the following versions:

```
"@apollo/client": "3.13.5",
"@apollo/client-integration-nextjs": "0.12.0"
```

However, we are finding the documentation very difficult to understand, as it is quite confusing and unclear.

Our issue arises when we try to use `useApolloClient()` from within a provider wrapped like this:

```tsx
const ApolloWrapper = ({ children }: ApolloProviderProps) => {
return {children};
}
```

We’re getting the error shown in the attached image. We’ve followed your Next.js examples repeatedly (we’re using version 18), but we still can’t get it to work properly.

We have several questions we'd like to clarify:

1. What is the correct way to make a client-side request using Apollo?
2. Do the `apolloClient` and `ApolloWrapper` files need to be placed in a specific directory?
3. Should the `makeClient` value in `ApolloWrapper` be the same as the one defined using `registerApolloClient`, or should we import `getClient` from that file and pass it directly as `makeClient`?
4. Server-side requests are working fine — the issue is only on the client side.

We would greatly appreciate a clear explanation or an up-to-date working example. Thank you very much for your support.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Next.js examples and the reported ApolloWrapper, apolloClient, registerApolloClient, and getClient usage. Reproduce the client-side useApolloClient error with the stated package versions, then clarify the supported setup, file placement, and makeClient relationship in an up-to-date working example.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, nextjs, typescript
Domain
api, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.