{"record":{"id":"a7aff0938936a24e","repo":"ReactiveX/rxjs","slug":"cannot-initialize-rxjs-observable-polyfill-abort","errorCode":null,"errorMessage":"Cannot initialize @rxjs/observable-polyfill: AbortController.prototype.abort is unavailable","messagePattern":"Cannot initialize @rxjs/observable-polyfill: AbortController\\.prototype\\.abort is unavailable","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"critical","filePath":"packages/observable-polyfill/src/index.ts","lineNumber":1385,"sourceCode":"    if (rollbackErrors.length > 0) {\n      throw new AggregateError(\n        [error, ...rollbackErrors],\n        'Cannot initialize @rxjs/observable-polyfill and could not fully restore the realm'\n      );\n    }\n    throw error;\n  }\n}\n\nfunction initializeObservablePolyfill(): void {\n  const installations: PropertyInstallation[] = [];\n  const activeObservable = (globalThis as typeof globalThis & { Observable?: ObservableCtor }).Observable;\n\n  if (activeObservable === undefined) {\n    const AbortControllerCtor = globalThis.AbortController;\n    const abortDescriptor = AbortControllerCtor && Object.getOwnPropertyDescriptor(AbortControllerCtor.prototype, 'abort');\n    if (!AbortControllerCtor || !abortDescriptor || typeof abortDescriptor.value !== 'function') {\n      throw new TypeError('Cannot initialize @rxjs/observable-polyfill: AbortController.prototype.abort is unavailable');\n    }\n\n    nativeAbort = abortDescriptor.value;\n    installations.push(\n      preparePropertyInstallation(\n        AbortControllerCtor.prototype,\n        'abort',\n        { ...abortDescriptor, value: abortWithObservableAlgorithms },\n        'AbortController.prototype.abort'\n      ),\n      preparePropertyInstallation(\n        globalThis,\n        'Subscriber',\n        {\n          configurable: true,\n          enumerable: false,\n          value: Subscriber,\n          writable: true,","sourceCodeStart":1367,"sourceCodeEnd":1403,"githubUrl":"https://github.com/ReactiveX/rxjs/blob/54796b38a57e6309f9861e174737479bb3f63f61/packages/observable-polyfill/src/index.ts#L1367-L1403","documentation":"The polyfill requires AbortController.prototype.abort (a real function on the prototype) to wire cancellation into the platform Subscriber lifecycle before it can install its Observable. If AbortController is missing, or abort is only an own/instance property or not a function, initialization refuses to proceed.","triggerScenarios":"Calling the polyfill install when globalThis.Observable is undefined AND globalThis.AbortController is missing (old Node <15, legacy browsers), or when an environment ships an AbortController shim whose abort is not a prototype-level function value.","commonSituations":"Node <15, IE11, jsdom configurations without AbortController, or overwriting globalThis.AbortController with a class that defines abort as an instance field instead of a prototype method.","solutions":["Provide a conforming AbortController (upgrade Node to >=15, or install a spec-compliant polyfill like abort-controller before importing @rxjs/observable-polyfill)","Verify Object.getOwnPropertyDescriptor(AbortController.prototype, 'abort') returns { value: function } in your environment","If you ship a custom AbortController, define abort on the prototype: AbortController.prototype.abort = function () {...}"],"exampleFix":"// before\nimport '@rxjs/observable-polyfill'; // TypeError: AbortController.prototype.abort is unavailable\n// after\nimport 'abort-controller/polyfill'; // or upgrade Node >= 15\nimport '@rxjs/observable-polyfill';","handlingStrategy":"validation","validationCode":"function canInstallPolyfill() {\n  return typeof globalThis.AbortController === 'function' &&\n    typeof Object.getOwnPropertyDescriptor(AbortController.prototype, 'abort')?.value === 'function';\n}","typeGuard":"const hasProtoAbort = (c: unknown): c is typeof AbortController =>\n  typeof c === 'function' &&\n  typeof Object.getOwnPropertyDescriptor((c as any).prototype, 'abort')?.value === 'function';","tryCatchPattern":null,"preventionTips":["Target Node >= 15 or include a conforming AbortController polyfill first","Smoke-test descriptor availability in CI for all supported environments","Define abort on the prototype, never as an instance field, in custom AbortController shims"],"tags":["polyfill","abortcontroller","environment","cancellation","node-version"],"backgroundTag":"missing-platform-api","analyzedSha":"54796b38a57e6309f9861e174737479bb3f63f61","analyzedAt":"2026-08-28T10:21:27.410Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}