Closed ninibear030 closed 2 months ago
That error message states that you are importing Server Component functionality in a Client Component. Are you sure that the file you are importing into is not used as a Client Component?
This doesn't have to be a file with "use client", it can also be a file imported by a file that has "use client", or even imported by a file that is imported by a file etc.
I used that in the page.tsx, I don't think its possible for it to be client side. 😞ðŸ˜
page.tsx
can also be a client component.
Unfortunately I fear I can't really help you with this without knowing your full project.
I think it might actually better if you asked in the Next.js Discord - from the error message you shared, it seems like this is not a bug in this package.
I'm doing some housekeeping so I'm closing some older issues that haven't seen activity in a while. If this is still relevant, please feel free to reopen the issue.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
I'm having the same issue 😢
@gersongams that means that you are importing a file that contains registerApolloClient
from a Client component.
That could also happen over a few corners - you import a file from a "use client"
file that imports a file that imports a file that imports registerApolloClient
.
That's not allowed in Next.js - things meant for the server have to stay on the "server side" of imports and things meant for the client have to stay on the "client side" of imports.
i am using next 14.0.4 "@apollo/client": "3.9.0-rc.1", "@apollo/experimental-nextjs-app-support": "^0.6.0", tutorial link: https://www.apollographql.com/blog/using-apollo-client-with-next-js-13-releasing-an-official-library-to-support-the-app-router
when I use it in my RSC i get error: