---
title: "Discussion on \"Live-Chat with SvelteKit and SocketIO\" | Hashnode"
description: "Discussion on \"Live-Chat with SvelteKit and SocketIO\". Add Socket.IO to your SvelteKit project and use the full power of realtime communication"
url: "https://hashnode.com/posts/live-chat-with-sveltekit-and-socketio/62002b373a8a6e5fe1198221"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Live-Chat with SvelteKit and SocketIO](https://linu.us/live-chat-with-sveltekit-and-socketio?utm_source=hashnode&utm_medium=feed)

Add Socket.IO to your SvelteKit project and use the full power of realtime communication

Feb 6, 2022 · 6 min read · linu.us  
Updated May 26, 2022  
Read the article

-   [#svelte](https://hashnode.com/tag/svelte)
-   [#socketio](https://hashnode.com/tag/socketio)
-   [#tutorial](https://hashnode.com/tag/tutorial)

## Written by

[Linus Benkner](https://hashnode.com/@EinLinuus)

@EinLinuus · Stuttgart, Germany

  
[View profile](https://hashnode.com/@EinLinuus)

Young developer based in Germany

Hey there, I'm a young developer building software on the web. Currently building snippet.land and Tubitor.

## Responses 3

Markdown supported · ⌘↵ to post

[liza](https://hashnode.com/@moonlightlizaa)

[Sep 21, 2023](https://hashnode.com/posts/live-chat-with-sveltekit-and-socketio/62002b373a8a6e5fe1198221/comment/650bfda68cd3ce237b6de32d)

Does this still work? Because I get an error

[Stefan Ammon](https://hashnode.com/@neueraeumlichkeit)

[Sep 19, 2022](https://hashnode.com/posts/live-chat-with-sveltekit-and-socketio/62002b373a8a6e5fe1198221/comment/632859d5195e7dc741da5529)

Hi Linus, many thanks for your SK/Socket.io approach! It might be the result of SvelteKits latest breaking changes, but I constantly run into the following error: "Error: config.kit.vite has been removed — use vite.config.js instead". Any Ideas how to overcome this issue?

[Linus Benkner](https://hashnode.com/@EinLinuus)

[Sep 19, 2022](https://hashnode.com/posts/live-chat-with-sveltekit-and-socketio/62002b373a8a6e5fe1198221/comment/632859d5195e7dc741da5529#reply-6328d4b0195e7dc741da6616)

Thanks for your feedback!

Not tested yet, but maybe this works: [pastebin.com/P2JSMC71](https://pastebin.com/P2JSMC71)

Put this in your `vite.config.js`. As far as I understand, the `vite` section from the `svelte.config.js` now moved to `vite.config.js`.

[Stefan Ammon](https://hashnode.com/@neueraeumlichkeit)

[Sep 27, 2022](https://hashnode.com/posts/live-chat-with-sveltekit-and-socketio/62002b373a8a6e5fe1198221/comment/632859d5195e7dc741da5529#reply-6332b10191ea68463fd5f31d)

Thank you Linus, meanwhile i was able to figure out how to deal with it. Following Matija´s tutorial ([joyofcode.xyz/using-websockets-with-sveltekit](https://joyofcode.xyz/using-websockets-with-sveltekit)) i just swapped the code from svelte.config.js to vite.config.js like this:

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1664265983562/ZjuCF5mUS.png)

which is actually the way you proposed. let´s keep on SvelteKitting ;)

[Parker Bedlan](https://hashnode.com/@parkerbedlan)

[May 26, 2022](https://hashnode.com/posts/live-chat-with-sveltekit-and-socketio/62002b373a8a6e5fe1198221/comment/628ede8719bda58ac7fb1e58)

Hi Linus, I've gone through this tutorial and everything works perfectly when I run the dev server, but as soon as I build it and try to run it, whether on my machine using the "build" and "preview" commands, or by deploying to vercel, the sockets don't work. Do you have a github repo that successfully implements this tutorial in production?

[Linus Benkner](https://hashnode.com/@EinLinuus)

[May 26, 2022](https://hashnode.com/posts/live-chat-with-sveltekit-and-socketio/62002b373a8a6e5fe1198221/comment/628ede8719bda58ac7fb1e58#reply-628f80a99a7f929c55a425e0)

Hi, thank you for your feedback! I actually found an issue when using it in production, so I've added a section on how to make it work in production. [linu.us/live-chat-with-sveltekit-and-socketio](https://linu.us/live-chat-with-sveltekit-and-socketio#heading-make-it-work-in-production)

I hope this helps, I'm sorry that I missed that part.
