{"record":{"id":"63907a9e1f878632","repo":"ReactiveX/rxjs","slug":"subscriber-addteardown-requires-a-callback","errorCode":null,"errorMessage":"Subscriber.addTeardown requires a callback","messagePattern":"Subscriber\\.addTeardown requires a callback","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/observable-polyfill/src/index.ts","lineNumber":195,"sourceCode":"    }\n\n    if (hasError) {\n      throw firstError;\n    }\n  }\n\n  get active(): boolean {\n    return !this.#closed;\n  }\n\n  get signal(): AbortSignal {\n    return this.#abortController.signal;\n  }\n\n  addTeardown(teardown: () => void): void {\n    this.#assertBrand();\n    if (arguments.length === 0 || typeof teardown !== 'function') {\n      throw new TypeError('Subscriber.addTeardown requires a callback');\n    }\n\n    if (!this.active) {\n      teardown();\n      return;\n    }\n\n    this.#teardowns.push(teardown);\n  }\n\n  next(value: T): void {\n    this.#assertBrand();\n    if (arguments.length === 0) {\n      throw new TypeError('Subscriber.next requires a value');\n    }\n\n    if (this.active) {\n      const observers = Array.from(this.#observerList);","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/ReactiveX/rxjs/blob/54796b38a57e6309f9861e174737479bb3f63f61/packages/observable-polyfill/src/index.ts#L177-L213","documentation":"Error \"Subscriber.addTeardown requires a callback\" thrown in ReactiveX/rxjs.","triggerScenarios":"Thrown at packages/observable-polyfill/src/index.ts:195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"54796b38a57e6309f9861e174737479bb3f63f61","analyzedAt":"2026-08-28T10:21:27.410Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}