Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websocket breaks when integrated with frameworK #1092

Open
Th4phat opened this issue Feb 26, 2025 · 1 comment
Open

websocket breaks when integrated with frameworK #1092

Th4phat opened this issue Feb 26, 2025 · 1 comment

Comments

@Th4phat
Copy link

Th4phat commented Feb 26, 2025

os: win 10
bun version: 1.2.2
elysia version: ^1.2.18

So, I'm running into a weird issue which I can't find any solution anywhere.
I'm trying to use Elysia's websockets with Next.js (15.1.7) and Astro (5.3.1), and they just don't want to connect. But, if I run the websocket endpoint with just Elysia, without those frameworks, it works perfectly fine. I'm not sure if this is a bug or just something I'm missing, but I haven't been able to figure it out. I haven't tried Svelte or Expo yet. If anyone has any ideas or knows how to fix this, I'd really appreciate the help.

here's the code I use to test:

.ws("/ws", {
    open(ws) {
      console.log("opennn");
    },
    message(ws, message) {
      ws.send(message);
    },
    close() {
      console.log("close");
    },
  })
@GGAlanSmithee
Copy link

were you able to find a solution to this @Th4phat ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants