diff --git a/src.ts/providers/abstract-provider.ts b/src.ts/providers/abstract-provider.ts index 913e85a21f..106fc10e7b 100644 --- a/src.ts/providers/abstract-provider.ts +++ b/src.ts/providers/abstract-provider.ts @@ -203,6 +203,16 @@ async function getSubscription(_event: ProviderEvent, provider: AbstractProvider return { type: "orphan", tag: getTag("orphan", event), filter: copy(event) }; } + if (typeof _event === 'string') { + try { + // `_event` could be an unparsed json string somehow? + // fixes https://github.com/ethers-io/ethers.js/issues/3767 + _event = JSON.parse(_event); + } catch (e) { + // + } + } + if (((_event).address || (_event).topics)) { const event = _event;