Skip to content

abort-controller package is not maintainable and doesn't support the latest whatwg/dom spec #55247

Description

@retyui

Description

React Native use 7 years old package abort-controller to polyfill AbortController & AbortSignal, see: https://github.com/facebook/react-native/blob/20779edd3bc9f1c205a063e15b324466ee509c24/packages/react-native/Libraries/Core/setUpXHR.js#L37-L44

fetch(url, { signal: AbortSignal.timeout(30_000) });
//                             ^^^ Crash: TypeError: AbortSignal.timeout is not a function (it is undefined)

Since there is no activity in this repo devs can't use modern API from whatwg/dom spec, examples:

Steps to reproduce

  1. Create a new RN app
  2. Do network request fetch(url, { signal: AbortSignal.timeout(30_000) });

Expected: no errors
Actual: Crash TypeError: AbortSignal.timeout is not a function

React Native Version

0.83.1

Affected Platforms

Runtime - Android, Runtime - iOS

Output of npx @react-native-community/cli info

info Fetching system and libraries information...
System:
  OS: macOS 15.7.3
  CPU: (11) arm64 Apple M3 Pro
  Memory: 103.56 MB / 36.00 GB
  Shell:
    version: 4.0.1
    path: /opt/homebrew/bin/fish
Binaries:
  Node:
    version: 20.19.4
    path: /usr/local/bin/node
  Yarn:
    version: 3.6.4
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.2
    path: /usr/local/bin/npm
  Watchman:
    version: 2025.09.01.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/i/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.2 AI-252.27397.103.2522.14617522
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /Users/i/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.2.0
    wanted: 19.2.0
  react-native:
    installed: 0.83.1
    wanted: 0.83.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

BUNDLE  ./index.js 
 ERROR  [runtime not ready]: TypeError: AbortSignal.timeout is not a function (it is undefined)
 LOG  Running "RN83" with {"rootTag":11,"initialProps":{},"fabric":true}

MANDATORY Reproducer

https://github.com/retyui/rn-abort-controller/blob/9768f7bd9ed6c0865b4951b586df4cdea5e5aacd/App.tsx#L45

Screenshots and Videos

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions