ReactiveX/rxjs · error · TypeError
Symbol.iterator must return an object
Error message
Symbol.iterator must return an object
What it means
Error "Symbol.iterator must return an object" thrown in ReactiveX/rxjs.
Source
Thrown at packages/observable-polyfill/src/index.ts:354
const method = (value as Record<PropertyKey, unknown>)[key];
if (method == null) {
return undefined;
}
if (typeof method !== 'function') {
throw new TypeError(`${String(key)} must be callable`);
}
return method as Callable;
}
function getSyncIteratorRecord<T>(value: object): SyncIteratorRecord<T> {
const iteratorMethod = getMethod(value, Symbol.iterator);
if (!iteratorMethod) {
throw new TypeError('Object does not define a callable Symbol.iterator method');
}
const iterator = iteratorMethod.call(value);
if (!isObject(iterator)) {
throw new TypeError('Symbol.iterator must return an object');
}
const next = getMethod(iterator, 'next');
if (!next) {
throw new TypeError('Iterator must define a callable next() method');
}
return { iterator, next };
}
function getAsyncIteratorRecord(value: object): AsyncIteratorRecord {
const asyncIteratorMethod = getMethod(value, Symbol.asyncIterator);
if (asyncIteratorMethod) {
const iterator = asyncIteratorMethod.call(value);
if (!isObject(iterator)) {
throw new TypeError('Symbol.asyncIterator must return an object');
}
return { iterator };
}View on GitHub (pinned to 54796b38a5)
When it happens
Trigger: Thrown at packages/observable-polyfill/src/index.ts:354 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of ReactiveX/rxjs@54796b38a5 (2026-08-28).
Data as JSON: /api/errors/1a23e65bfaaa4b07.
Report an issue: GitHub.