Socket.io in Nextjs : hydratation error
Unanswered
Belgian Hare posted this in #help-forum
Belgian HareOP
Hello everyone,
I'm trying to implement socket.io in nextjs app.
But I have a hydratation error when I try to access my page.
I put screenshots to view my code.
Anyone have an idee to fix this bug ?
Thanks a lot !
I'm trying to implement socket.io in nextjs app.
But I have a hydratation error when I try to access my page.
I put screenshots to view my code.
Anyone have an idee to fix this bug ?
Thanks a lot !
5 Replies
I had this error, but it only occurred in development mode. Once it was in production and live, it disappeared. The issue was due to having the 'LastPass' extension enabled in my Chrome browser. It might be related to other autofill extensions you have active.
Dark-eyed Junco
Hello, nice to meet you here!
Next.js uses server-side rendering (SSR) by default, which can sometimes cause issues with client-side libraries like Socket.io. Make sure that Socket.io is only initialized on the client side to avoid hydration errors.
If you have more questions, please DM.
@jaycoda I had this error, but it only occurred in development mode. Once it was in production and live, it disappeared. The issue was due to having the 'LastPass' extension enabled in my Chrome browser. It might be related to other autofill extensions you have active.
Belgian HareOP
Thanks to your reply. I have a chrome extension, Proton Pass, for my password. I disabled it, but the issue persist... The problem doesn't have to come from here ^^