-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What version of Elysia is running?
1.4.13
What version of Node Adapter are you using?
1.4.1
What platform is your computer?
Linux 6.17.4-arch2-1 x86_64 unknown
What steps can reproduce the bug?
- Copy the following program into a new project's
index.ts
import node from "@elysiajs/node";
import { Elysia } from "elysia";
const app = new Elysia({
adapter: node()
})
.ws("/ws", {
open(ws) { console.log(ws.data); }
}).listen(3000, ({hostname, port}) => {
console.log(`Elysia running at ${hostname}:${port}`);
});- Run with
npm run dev(this should betsx watch src/index.tsfor node project) - Open a websocket connection to the application (e.g. through Postman)
- Observe
What is the expected behavior?
The bun version's output
pwsh> bun run dev
$ bun --watch src/index.ts
Elysia is running at localhost:3000
{
request: Request (0 KB) {
method: "GET",
url: "http://localhost:3000/ws",
headers: Headers {
"sec-websocket-version": "13",
"sec-websocket-key": "XXp4h6PtTrfX0A+ZeWHkhw==",
"connection": "Upgrade",
"upgrade": "websocket",
"sec-websocket-extensions": "permessage-deflate; client_max_window_bits",
"host": "localhost:3000",
}
},
store: {},
qi: -1,
path: "/ws",
url: "http://localhost:3000/ws",
redirect: [Function: redirect],
status: [Function: status],
set: {
headers: [Object: null prototype] {},
status: 200,
cookie: {},
},
headers: {
"sec-websocket-version": "13",
"sec-websocket-key": "XXp4h6PtTrfX0A+ZeWHkhw==",
connection: "Upgrade",
upgrade: "websocket",
"sec-websocket-extensions": "permessage-deflate; client_max_window_bits",
host: "localhost:3000",
},
cookie: {},
query: [Object: null prototype] {},
route: "/ws",
validator: undefined,
id: [Getter],
ping: [Function: ping],
pong: [Function: pong],
open: [AsyncFunction: open],
message: [AsyncFunction: message],
drain: [AsyncFunction: drain],
close: [AsyncFunction: close],
}
What do you see instead?
pwsh> npm run dev
> dev
> tsx watch src/index.ts
Elysia running at localhost:3000
undefined
Additional information
No response
Have you try removing the node_modules and bun.lockb and try again yet?
yes
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working