{"record":{"id":"be22839d55da0cf7","repo":"ReactiveX/rxjs","slug":"must-combine-observable-instance-with-an-array-of","errorCode":null,"errorMessage":"Must combine observable instance with an array of observable values","messagePattern":"Must combine observable instance with an array of observable values","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/rxjs/src/combine-latest.ts","lineNumber":56,"sourceCode":"    };\n  }\n}\n\nObservable[combineLatest] = combineLatestImpl;\nObservable.prototype[combineLatest] = combineLatestImpl;\n\nfunction combineLatestImpl<Sources extends readonly ObservableValue<any>[] | { [key: string]: ObservableValue<any> }>(\n  this: ObservableCtor | Observable<any>,\n  sources: Sources,\n  configOrProject?: { requireAllValues?: boolean } | ((...values: any[]) => any)\n): Observable<CombineLatestValues<Sources> | any> {\n  const project = typeof configOrProject === 'function' ? configOrProject : undefined;\n  const config = typeof configOrProject === 'object' && configOrProject !== null ? configOrProject : {};\n  const { requireAllValues = true } = config;\n\n  if (isObservableInstance(this)) {\n    if (!Array.isArray(sources)) {\n      throw new TypeError('Must combine observable instance with an array of observable values');\n    }\n    const combined = this[combine](\n      sources.map((source) => ({\n        source,\n        requireFirstValue: requireAllValues,\n      }))\n    );\n    return project === undefined ? (combined as any) : combined[map]((values) => project(...values));\n  }\n\n  const actualSources: readonly ObservableValue<any>[] | { [key: string]: ObservableValue<any> } = Array.isArray(sources)\n    ? [...sources]\n    : { ...sources };\n\n  if (isSourceArray(actualSources)) {\n    const combined = this[combine](\n      actualSources.map((source) => ({\n        source,","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/ReactiveX/rxjs/blob/54796b38a57e6309f9861e174737479bb3f63f61/packages/rxjs/src/combine-latest.ts#L38-L74","documentation":"When combineLatest is invoked on an Observable instance (this[combineLatest](...)), RxJS Next requires the argument to be an array of observable sources; passing anything else (an object, a single observable, a function) is a type error.","triggerScenarios":"observable[combineLatest](sourceB) or observable[combineLatest]({a: obsA}) — instance form requires combineLatest([obsB]) with a literal array. Also triggered by spreading a non-array iterable or passing undefined.","commonSituations":"Migrating RxJS 7 code where combineLatestInstance accepted different shapes, or dynamically building the sources argument and accidentally passing a single observable or an object dictionary to the instance form.","solutions":["Pass an array: observable[combineLatest]([other1, other2])","If you have a dictionary of sources, use the static/standalone combineLatest({a: obsA, b: obsB}) form instead of the instance form","Wrap dynamic arguments: observable[combineLatest](Array.from(iterableOfSources))"],"exampleFix":"// before\nconst combined = a[combineLatest](b);\n// after\nconst combined = a[combineLatest]([b]);","handlingStrategy":"type-guard","validationCode":"if (!Array.isArray(sources)) throw new TypeError('expected array of sources');\nobs[combineLatest](sources);","typeGuard":"const isObservableArray = (v: unknown): v is Observable<any>[] =>\n  Array.isArray(v) && v.every((s) => typeof (s as any)?.[Symbol.observable] === 'function' || s instanceof Observable);","tryCatchPattern":null,"preventionTips":["Always pass a literal array to the instance combineLatest form","Use the dictionary form only with the standalone combineLatest function","Type the parameter as Observable<T>[] so the compiler catches misuse"],"tags":["combine-latest","argument-validation","rxjs-next","api-misuse"],"backgroundTag":"invalid-argument-shape","analyzedSha":"54796b38a57e6309f9861e174737479bb3f63f61","analyzedAt":"2026-08-28T10:21:27.410Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}