jeddeloh / rescript-apollo-client

ReScript bindings for the Apollo Client ecosystem
MIT License
126 stars 18 forks source link

support to nextjs ? #145

Closed enieber closed 2 years ago

enieber commented 2 years ago

Hi, this project is very nice, I starting with rescript and graphql with this lib and no has any error, but when I transfer this application to nextjs I found some errors:

Error: Unable to find native implementation, or alternative implementa

Screenshot error tion for WebSocket!

the project sample nextjs is open source

Do I need to change any settings?

jeddeloh commented 2 years ago

I think WebSocketLink needs to be run in a browser environment, so if you're doing SSR in Next, Websocket won't be available. You'll need to do some extra checks when configuring your Apollo Client. I did a quick google search and this looks relevant to your situation: https://github.com/apollographql/subscriptions-transport-ws/issues/333#issuecomment-359261024

enieber commented 2 years ago

I removed the websocket config, thanks