What version of Elysia is running?
elysia@1.4.29
What platform is your computer?
Darwin 25.5.0 arm64 arm
What environment are you using
Node v24.19.0
Are you using dynamic mode?
No
What steps can reproduce the bug?
Try to set the Content-Type header in the error method
app.onError(({ code, set }): ProblemDetails | void => {
if (code === "NOT_FOUND") {
set.headers["content-type"] = "application/problem+json";
return { status: 404, title: "Not Found" };
}
});
What is the expected behavior?
The Content-Type header to be application/problem+json
What do you see instead?
The Content-Type header is application/json
Additional information
I'm trying to implement the Problem Details pattern (related #1902). It return errors as JSON with the content type application/problem+json. However, the onError handler is ignoring the value I set and using application/json instead
Have you try removing the node_modules and bun.lock and try again yet?
Yes
What version of Elysia is running?
elysia@1.4.29
What platform is your computer?
Darwin 25.5.0 arm64 arm
What environment are you using
Node v24.19.0
Are you using dynamic mode?
No
What steps can reproduce the bug?
Try to set the
Content-Typeheader in the error methodWhat is the expected behavior?
The
Content-Typeheader to beapplication/problem+jsonWhat do you see instead?
The
Content-Typeheader isapplication/jsonAdditional information
I'm trying to implement the Problem Details pattern (related #1902). It return errors as JSON with the content type
application/problem+json. However, the onError handler is ignoring the value I set and usingapplication/jsoninsteadHave you try removing the
node_modulesandbun.lockand try again yet?Yes