[GH-ISSUE #1306] docs: fromNodeHeaders utility is not compatible with getRequestHeaders in Nitro #8685

Closed
opened 2026-04-13 03:50:51 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @josselinonduty on GitHub (Jan 30, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1306

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Create a nitro backend (https://better-auth.vercel.app/docs/integrations/nitro)
  2. Create require-auth guard (https://better-auth.vercel.app/docs/integrations/nitro#auth-guardmiddleware)
  3. Observe type error

Current vs. Expected behavior

Argument of type 'Partial<Record<HTTPHeaderName, string | undefined>>' is not assignable to parameter of type 'IncomingHttpHeaders'.
  Types of property '"set-cookie"' are incompatible.
    Type 'string | undefined' is not assignable to type 'string[] | undefined'.
      Type 'string' is not assignable to type 'string[]'.ts(2345)

What version of Better Auth are you using?

1.1.15

Provide environment information

- OS: Ubuntu 24.04

Which area(s) are affected? (Select all that apply)

Types

Auth config (if applicable)


Additional context

I will create a pr with a fix.

Originally created by @josselinonduty on GitHub (Jan 30, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1306 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Create a nitro backend (https://better-auth.vercel.app/docs/integrations/nitro) 2. Create `require-auth` guard (https://better-auth.vercel.app/docs/integrations/nitro#auth-guardmiddleware) 3. Observe type error ### Current vs. Expected behavior ```ts Argument of type 'Partial<Record<HTTPHeaderName, string | undefined>>' is not assignable to parameter of type 'IncomingHttpHeaders'. Types of property '"set-cookie"' are incompatible. Type 'string | undefined' is not assignable to type 'string[] | undefined'. Type 'string' is not assignable to type 'string[]'.ts(2345) ``` ### What version of Better Auth are you using? 1.1.15 ### Provide environment information ```bash - OS: Ubuntu 24.04 ``` ### Which area(s) are affected? (Select all that apply) Types ### Auth config (if applicable) ```typescript ``` ### Additional context I will create a pr with a fix.
GiteaMirror added the lockedbug labels 2026-04-13 03:50:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8685