Skip to content

context.options.headers.get is not a function #521

@dongnaebi

Description

@dongnaebi

Environment

all environment

Reproduction

export const $ofetch = ofetch.create({
  timeout: 15000,
  onRequest({ options }) {
    options.headers = {
      ...options.headers,
      Authorization: token.value,
      UUID: uuid.value
    } as any
  },
})

Describe the bug

context.options.headers.get is not a function

I started getting this error after upgrading to version 1.5.0 — everything worked fine in 1.4.1 and earlier versions.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions