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

Bun.server() occasionally throwing Maximum call stack size exceeded when using "development: false" #16988

Open
helloryuko opened this issue Feb 2, 2025 · 0 comments
Labels
bug Something isn't working bun:serve Bun.serve and HTTP server needs investigate Needs to be investigated to find the root cause

Comments

@helloryuko
Copy link

What version of Bun is running?

1.2.2+c1708ea6a

What platform is your computer?

Linux 6.8.0-51-generic x86_64 x86_64 (distro: Ubuntu 24.04 LTS)

What steps can reproduce the bug?

index.ts

import { serve } from "bun";

export default serve({
    port: 8877,
    hostname: "localhost",
    development: false,

    fetch(req) {
        return new Response("Bun!");
    },
});

Everything else are just regular files from bun init

What is the expected behavior?

The HTTP server to work as intended in both development and production modes

What do you see instead?

Development mode works perfectly fine, while development: false errors every request out with RangeError: Maximum call stack size exceeded.
Occasionally after a few restarts the server works alright (as demonstrated in the video), but after another restart it breaks again.

demo: https://youtu.be/pz5DpLAWT40

Additional information

No response

@helloryuko helloryuko added bug Something isn't working needs triage labels Feb 2, 2025
@RiskyMH RiskyMH added bun:serve Bun.serve and HTTP server needs investigate Needs to be investigated to find the root cause and removed needs triage labels Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun:serve Bun.serve and HTTP server needs investigate Needs to be investigated to find the root cause
Projects
None yet
Development

No branches or pull requests

2 participants