sindresorhus / ky

🌳 Tiny & elegant JavaScript HTTP client based on the browser Fetch API
MIT License
11.83k stars 341 forks source link

[TypeError: signal.throwIfAborted is not a function (it is undefined)] in React Native context #588

Closed psam44 closed 1 month ago

psam44 commented 1 month ago

Upgrading from 0.31.4 to 1.2.3.

Here are my traces:

 LOG  signal {}
 LOG  signal.reason undefined
 LOG  signal.aborted false
 LOG  signal.onabort null
 LOG  signal.throwIfAborted undefined
 LOG  signal.addEventListener [Function addEventListener]
 LOG  signal.removeEventListener [Function removeEventListener]

These are conformant with the definitions found in node_modules\react-native\types\modules\globals.d.ts

Extracts:

declare class AbortSignal implements EventTarget {
  readonly aborted: boolean;
  onabort: (event: AbortEvent) => void;
  addEventListener: (
  removeEventListener: (
sindresorhus commented 1 month ago

This is a problem with React Native and should be reported there instead.

andredewaard commented 1 month ago

@psam44 Found a solution?

psam44 commented 1 month ago

@andredewaard No solution. My conclusion is to come back to v0.33 for now, and plan for elimination, as supporting this package in react-native doesn't seem to be an objective and I don't expect RN to fully implement the AbortSignal API.

andredewaard commented 1 month ago

Alright, thanks for the heads up, i reverted back to using native Fetch instead.