Native Websocket is not defined
Hi, i tried the native websocket like this but i got 500 > WebSocket is not defined. My IDE has no problem but nuxt has it.
Then i installed this package but still same error because this package uses the native websocket
12 Replies
WebSocket - Nitro
Nitro natively support a cross platform WebSocket API
don't wont for server side, only client side
not sure what you mean
Alexander Lichter
YouTube
Integrating WebSockets in Nuxt and Nitro
🎉 Nitro 2.9 was released just before Vue.js Amsterdam and brings new features such as a database layer, a task API and also WebSocket support! But how can we integrate it in a Nuxt application? This video will teach you 👌
Key points:
🛠 How to set up WebSockets in Nitro and in Nuxt
💡 Working from scratch to a functional application
⚠️ Hints to m...
But try that
i dont want to use it as a server, only as a client and connect with this to a server
Where is your server/what service?
I know supabase has an implementation in their library if you use them
no
own implementation of a websocket server written in java
Unless you’ve disabled SSR, you’ll need to conditionally instantiate a websocket instance in the client. The
WebSocket is not defined
reference error is usually a clue that its execution environment is server-side.how can i disable this?
ssr: false
in your nuxt configgot it, thanks
worked thanks