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

When using Response.json(), server returns with "response.headers.toJSON is not a function" #5

Open
maplefluff opened this issue May 2, 2024 · 0 comments

Comments

@maplefluff
Copy link

Using node v20.10.0, using Response.json() will make the server return with "response.headers.toJSON is not a function".
I'm using elysia "v1.0.16" and elysia-polyfills "v0.6.4". I'm assuming this is to do with the pollyfills since if i use elysia with something like cloudflare workers where the polyfills arent needed, it works fine

As a little test i used this

new Elysia()
	.get("/one", new Response("test"))
	.get("/two", Response.json({ message: "test" }))
	.get("/three", { message: "test" })
	.get("/four", "test")
	.listen(5000);

going to everything except for "/two" returns how it should

image
image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant