Skip to content

Providing explicit hostname leads to 500 error on any endpoint #41

@PieceOfMeat

Description

@PieceOfMeat

What version of Elysia is running?

1.3.5

What version of Node Adapter are you using?

1.3.0

What platform is your computer?

Darwin 24.5.0 x86_64 i386

What steps can reproduce the bug?

Copy-paste the code from "Quick Start" documentation page for Node.js and change listen(3000, ...) to listen({ hostname: "127.0.0.1", port: 3000 }, ...)

import { Elysia } from "elysia"
import { node } from "@elysiajs/node"

const app = new Elysia({ adapter: node() })
  .get("/", () => "Hello Elysia")
  .listen({ hostname: "127.0.0.1", port: 3000 }, ({ hostname, port }) => {
    console.log(
      `🦊 Elysia is running at ${hostname}:${port}`,
    )
  })

What is the expected behavior?

When I go to localhost:3000, I can see "Hello, Elysia" text.

What do you see instead?

I see Elysia returning HTTP 500 Internal Server Error instead.
No errors in server console, no info to trace possible cause

Additional information

This works seamlessly in Bun version of Elysia

Have you try removing the node_modules and bun.lockb and try again yet?

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions