jstack icon indicating copy to clipboard operation
jstack copied to clipboard

Unable to use websockets

Open Shivam-002 opened this issue 10 months ago • 2 comments

Description

I followed the WebSocket setup as described in the JStack docs, but I encountered the following errors:

  1. async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding 'use client' to a module that was originally written for the server.

  2. A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.

  3. TypeError: socket.on is not a function

Reproduction Steps

  1. Started from the official JStack WebSocket example.
  2. Implemented the WebSocket connection as shown in the docs.
  3. Ran the project and encountered the above errors.

Shivam-002 avatar Feb 02 '25 16:02 Shivam-002