getSetCookie is not a function
I've upgraded a Workers project by bumping Hono and Wrangler by a few minor versions. In staging, I'm now seeing:
"TypeError: this[#res].headers.getSetCookie is not a function"
in my streaming logs. This didn't exist before.
Anyone have ideas on how to resolve this or suggestions on where to dig? Does this sound like a Hono, Node, or Workers?
More Info: I reverted Hono back to the original version and still have the same issue.
This DOES work in local development. Maybe it's just something else I've changed.2 Replies
There is this line in the Hono source:
const cookies = this.#res.headers.getSetCookie()
https://github.com/honojs/hono/blob/main/src/context.ts#L407
I just can't understand why this works in production on an old build and not staging on a new build.GitHub
hono/src/context.ts at main · honojs/hono
Web framework built on Web Standards. Contribute to honojs/hono development by creating an account on GitHub.
The problem was actually with Cloudflare configuration.
https://developers.cloudflare.com/workers/configuration/compatibility-dates/#headers-supports-getsetcookie
Cloudflare Docs
Compatibility dates | Cloudflare Workers docs
Opt into a specific version of the Workers runtime for your Workers project.