Skip to content

Fetch init.signal error #65

@WcaleNieWolny

Description

@WcaleNieWolny
Error: packRequest: init.signal
    at packRequest (blob:null/74878e83-1a35-4f3c-a67a-93d94adee03e:1003:50)
    at blob:null/74878e83-1a35-4f3c-a67a-93d94adee03e:765:22
    at fetchWithTimeout (blob:null/b9119e73-2aec-4ae2-bd38-1b596890bc68:32228:28)
    at fallback (blob:null/b9119e73-2aec-4ae2-bd38-1b596890bc68:32263:29

Code to reproduce:

async function fetchWithTimeout(resource: RequestInfo, options: RequestOptions = {}): Promise<Response> {
  const controller = new AbortController()

  console.log('fetch', resource)
  const { timeout = 5000 } = options
  console.log('timeout', timeout)

  const id = setTimeout(() => {
    console.log('timeout')
    controller.abort()
  }, timeout)
  const response = await fetch(resource, {
    signal: controller.signal,
  })
  clearTimeout(id)
  return response
}

Line causing: here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions