T
TanStack5w ago
conscious-sapphire

« The connection was closed » error with bun hosting

Hey, so I'm using the bun server hosting method just as pointed out in the docs, use the exact same file and I have one app that works and is hosted using that script. But, when trying to host my other app (which is fairly complex), locally it always works. But when hosting it on coolify (same build / start commands as on my machine, same node version too) I don't know at all why this error happens and I'm simply seeking for help here because I couldn't get any information on this. I tried plenty of things. Here's the error I get :
309 | status: 404,
310 | message: `Cannot find any route matching [${event.req.method}] ${event.url}`
311 | });
312 | if (val && val instanceof Error) {
313 | const isHTTPError = HTTPError.isError(val);
314 | const error = isHTTPError ? val : new HTTPError(val);
^
error: The connection was closed.
cause: DOMException {
stack: "",
code: 20,
name: "AbortError",
message: "The connection was closed.",
INDEX_SIZE_ERR: 1,
DOMSTRING_SIZE_ERR: 2,
HIERARCHY_REQUEST_ERR: 3,
WRONG_DOCUMENT_ERR: 4,
INVALID_CHARACTER_ERR: 5,
NO_DATA_ALLOWED_ERR: 6,
NO_MODIFICATION_ALLOWED_ERR: 7,
NOT_FOUND_ERR: 8,
NOT_SUPPORTED_ERR: 9,
INUSE_ATTRIBUTE_ERR: 10,
INVALID_STATE_ERR: 11,
SYNTAX_ERR: 12,
INVALID_MODIFICATION_ERR: 13,
NAMESPACE_ERR: 14,
INVALID_ACCESS_ERR: 15,
VALIDATION_ERR: 16,
TYPE_MISMATCH_ERR: 17,
SECURITY_ERR: 18,
NETWORK_ERR: 19,
ABORT_ERR: 20,
URL_MISMATCH_ERR: 21,
QUOTA_EXCEEDED_ERR: 22,
TIMEOUT_ERR: 23,
INVALID_NODE_TYPE_ERR: 24,
DATA_CLONE_ERR: 25,
toString: [Function: toString],
},
status: 500,
statusText: undefined,
headers: undefined,
data: undefined,
body: undefined,
unhandled: true,

at prepareResponse (/app/node_modules/h3-v2/dist/h3.mjs:314:37)
at toResponse (/app/node_modules/h3-v2/dist/h3.mjs:301:19)
309 | status: 404,
310 | message: `Cannot find any route matching [${event.req.method}] ${event.url}`
311 | });
312 | if (val && val instanceof Error) {
313 | const isHTTPError = HTTPError.isError(val);
314 | const error = isHTTPError ? val : new HTTPError(val);
^
error: The connection was closed.
cause: DOMException {
stack: "",
code: 20,
name: "AbortError",
message: "The connection was closed.",
INDEX_SIZE_ERR: 1,
DOMSTRING_SIZE_ERR: 2,
HIERARCHY_REQUEST_ERR: 3,
WRONG_DOCUMENT_ERR: 4,
INVALID_CHARACTER_ERR: 5,
NO_DATA_ALLOWED_ERR: 6,
NO_MODIFICATION_ALLOWED_ERR: 7,
NOT_FOUND_ERR: 8,
NOT_SUPPORTED_ERR: 9,
INUSE_ATTRIBUTE_ERR: 10,
INVALID_STATE_ERR: 11,
SYNTAX_ERR: 12,
INVALID_MODIFICATION_ERR: 13,
NAMESPACE_ERR: 14,
INVALID_ACCESS_ERR: 15,
VALIDATION_ERR: 16,
TYPE_MISMATCH_ERR: 17,
SECURITY_ERR: 18,
NETWORK_ERR: 19,
ABORT_ERR: 20,
URL_MISMATCH_ERR: 21,
QUOTA_EXCEEDED_ERR: 22,
TIMEOUT_ERR: 23,
INVALID_NODE_TYPE_ERR: 24,
DATA_CLONE_ERR: 25,
toString: [Function: toString],
},
status: 500,
statusText: undefined,
headers: undefined,
data: undefined,
body: undefined,
unhandled: true,

at prepareResponse (/app/node_modules/h3-v2/dist/h3.mjs:314:37)
at toResponse (/app/node_modules/h3-v2/dist/h3.mjs:301:19)
Any of you have an idea? Thanks!
1 Reply
fascinating-indigo
fascinating-indigo5w ago
@Magnus May maybe you have a lue?

Did you find this page helpful?