#Socket.io in Nextjs : hydratation error

6 messages · Page 1 of 1 (latest)

tall walrus
#

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 !

gaunt kindleBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

kindred fern
#

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.

magic blaze
#

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.