diff --git a/package.json b/package.json index ccad1b8..f26eb6f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "2.2.2", + "version": "2.2.3", "license": "MIT", "files": [ "dist", diff --git a/src/redux-devtools/mobx-redux-devtools.ts b/src/redux-devtools/mobx-redux-devtools.ts index 2a86f10..adfe8c2 100644 --- a/src/redux-devtools/mobx-redux-devtools.ts +++ b/src/redux-devtools/mobx-redux-devtools.ts @@ -41,19 +41,21 @@ const startSpyReport = (event: PureSpyEvent) => { return; } scheduled.push(() => { - try { - const name = getDebugName(event.object) + event.name; - } catch (e: any) { - if (config.debug) { - console.warn('Spy object is not observable: ' + e.message); + setTimeout(() => { + try { + const name = getDebugName(event.object) + event.name; + } catch (e: any) { + if (config.debug) { + console.warn('Spy object is not observable: ' + e.message); + } + return; } - return; - } - const name = debugNameToHuman(getDebugName(event.object) + event.name); - const devTools = devtoolsMap.get(getDebugName(event.object)); - if (devTools) { - devTools.send(name, toJsWithComputeds(event.object)); - } + const name = debugNameToHuman(getDebugName(event.object) + event.name); + const devTools = devtoolsMap.get(getDebugName(event.object)); + if (devTools) { + devTools.send(name, toJsWithComputeds(event.object)); + } + }); }); };