Skip to content

export default syntax of HTTP server won't work if the exported object has a stop method #26747

@guyutongxue

Description

@guyutongxue

What version of Bun is running?

1.3.8+b64edcb49

What platform is your computer?

Darwin 25.2.0 arm64 arm

What steps can reproduce the bug?

server.ts:

export default {
  fetch: () => new Response(`Hello world`),
  stop: () => {},
};

then bun server.ts.

What is the expected behavior?

Started development server: http://localhost:3000

HTTP server should launched where the stop method shouldn't affect that.

What do you see instead?

No output, program exited successfully.

Additional information

Elysia's app instance provided a stop method as its own property, which blocks export default new Elysia()... to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions