-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Express.js middlewares are reused when creating a second Express app #7031
Comments
This is likely a difference in behaviour for when listening to the same port twice. We will fix it. |
Can confirm, it only happens if the same port is used multiple times. |
I can confirm that calling |
Yep, that should be a good fix. |
This forces the app close within the Bun.serve listener for node http, if we don't do this, the issue appears where if you instantly recreate a listener on the same port, its hitting the old server causing weird issues. Fixes: oven-sh#7031 Related: oven-sh#6632
Still appears in |
What version of Bun is running?
1.0.11+f7f6233ea
What platform is your computer?
Darwin 23.0.0 arm64 arm
What steps can reproduce the bug?
Running
bun x.js
Expected: numbers to be different
Got: numbers are same
Running
node x.js
Expected: numbers to be different
Got: numbers are different
What is the expected behavior?
Bun: numbers should be different (middlewares are redeclared)
Express: numbers should be different (middlewares are redeclared)
What do you see instead?
Bun: numbers are the same (middlewares are reused)
Express: numbers should be different (middlewares are redeclared
Findings
In Bun the express middlewares seem to be reused.
Additional information
node version
v18.18.2
express version
4.18.2
The text was updated successfully, but these errors were encountered: