{"record":{"id":"eecaa4e87b351893","repo":"ReactiveX/rxjs","slug":"scheduler-backed-sharereplay-is-not-supported-by-t","errorCode":null,"errorMessage":"Scheduler-backed shareReplay is not supported by this Symbol contract.","messagePattern":"Scheduler-backed shareReplay is not supported by this Symbol contract\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/rxjs/src/share-replay.ts","lineNumber":27,"sourceCode":"  refCount: boolean;\n  scheduler?: unknown;\n}\n\ndeclare global {\n  interface Observable<T> {\n    [shareReplay](config: ShareReplayConfig): Observable<T>;\n    [shareReplay](bufferSize?: number, windowTime?: number, scheduler?: unknown): Observable<T>;\n  }\n}\n\nObservable.prototype[shareReplay] = function <T>(\n  this: Observable<T>,\n  configOrBufferSize?: ShareReplayConfig | number,\n  windowTime = Infinity,\n  scheduler?: unknown\n): Observable<T> {\n  if (scheduler !== undefined) {\n    throw new Error('Scheduler-backed shareReplay is not supported by this Symbol contract.');\n  }\n\n  let bufferSize = Infinity;\n  let refCount = false;\n\n  if (configOrBufferSize && typeof configOrBufferSize === 'object') {\n    if (configOrBufferSize.scheduler !== undefined) {\n      throw new Error('Scheduler-backed shareReplay is not supported by this Symbol contract.');\n    }\n\n    bufferSize = configOrBufferSize.bufferSize ?? Infinity;\n    windowTime = configOrBufferSize.windowTime ?? Infinity;\n    refCount = configOrBufferSize.refCount ?? false;\n  } else {\n    bufferSize = configOrBufferSize ?? Infinity;\n  }\n\n  return this[share]({","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/ReactiveX/rxjs/blob/54796b38a57e6309f9861e174737479bb3f63f61/packages/rxjs/src/share-replay.ts#L9-L45","documentation":"shareReplay in RxJS Next has no scheduler support. A non-undefined 4th positional argument (the legacy scheduler slot) throws immediately.","triggerScenarios":"source[shareReplay](1, 1000, undefined, asyncScheduler) or any shareReplay call with 4 arguments where the last is a scheduler.","commonSituations":"RxJS 7 timing-controlled replay code running un-migrated against RxJS Next.","solutions":["Drop the scheduler argument: source[shareReplay]({ bufferSize: 1, windowTime: 1000 })","Prefer the config-object form over positional args for clarity","Handle timing via the surrounding pipeline or TestScheduler in tests"],"exampleFix":"// before\nsource[shareReplay](1, 1000, undefined, asyncScheduler);\n// after\nsource[shareReplay]({ bufferSize: 1, windowTime: 1000 });","handlingStrategy":"validation","validationCode":"if (arguments.length > 3) throw new TypeError('scheduler not supported');\nsource[shareReplay]({ bufferSize, windowTime });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the config-object form of shareReplay","Strip scheduler args during RxJS Next migration"],"tags":["share-replay","scheduler","rxjs-next","migration","removed-api"],"backgroundTag":"removed-scheduler-argument","analyzedSha":"54796b38a57e6309f9861e174737479bb3f63f61","analyzedAt":"2026-08-28T10:21:27.410Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}