{"record":{"id":"7eea016fa4f4cd56","repo":"mobxjs/mobx","slug":"mobx-error-in-reaction-this-name-suppress","errorCode":null,"errorMessage":"[mobx] (error in reaction '${this.name_}' suppressed, fix error of causing action below)","messagePattern":"\\[mobx\\] \\(error in reaction '(.+?)' suppressed, fix error of causing action below\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/mobx/src/core/reaction.ts","lineNumber":207,"sourceCode":"    }\n\n    reportExceptionInDerivation_(error: any) {\n        if (this.errorHandler_) {\n            this.errorHandler_(error, this)\n            return\n        }\n\n        if (globalState.disableErrorBoundaries) {\n            throw error\n        }\n\n        const message = __DEV__\n            ? `[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '${this}'`\n            : `[mobx] uncaught error in '${this}'`\n        if (!globalState.suppressReactionErrors) {\n            console.error(message, error)\n            /** If debugging brought you here, please, read the above message :-). Tnx! */\n        } else if (__DEV__) { console.warn(`[mobx] (error in reaction '${this.name_}' suppressed, fix error of causing action below)`) } // prettier-ignore\n\n        if (__DEV__ && isSpyEnabled()) {\n            spyReport({\n                type: \"error\",\n                name: this.name_,\n                message,\n                error: \"\" + error\n            })\n        }\n\n        globalState.globalReactionErrorHandlers.forEach(f => f(error, this))\n    }\n\n    dispose() {\n        if (!this.isDisposed) {\n            this.isDisposed = true\n            if (!this.isRunning) {\n                // if disposed while running, clean up later. Maybe not optimal, but rare case","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/mobxjs/mobx/blob/01211a698b64ea94de8e5f276ff8235fcf8ddf96/packages/mobx/src/core/reaction.ts#L189-L225","documentation":"When a reaction or observer component throws, MobX catches the error (unless error boundaries are disabled) and logs it. If the error was thrown while MobX was already running an action on behalf of that reaction (suppressReactionErrors is set), the original error is logged first and MobX additionally prints this warning telling you the reaction's own error report was suppressed and to fix the underlying action error listed above it.","triggerScenarios":"An exception thrown inside an action that runs as part of a reaction's effect (e.g. inside runInAction called from a reaction callback, or an observer's render triggering an action) in a __DEV__ build with the default error boundaries enabled.","commonSituations":"Actions mutating state that fails validation and throws while a reaction is processing; unhandled promise rejections inside reaction callbacks; debugging cascading errors where the first stack line is the real one.","solutions":["Fix the error printed ABOVE this warning — the suppressed message is secondary; the causing action's error is the root cause","Wrap risky action bodies in try/catch or validate state before mutating","Temporarily set configure({ disableErrorBoundaries: true }) in dev to get the full uncaught stack","Ensure async work inside reactions handles rejections explicitly"],"exampleFix":"// before\nreaction(() => data.value, v => process(v)) // process throws\n// after\nreaction(() => data.value, v => {\n    try { process(v) } catch (e) { console.error('action failed', e) }\n})","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"function isSuppressedReactionWarning(msg: string): boolean {\n    return msg.includes(\"error in reaction\") && msg.includes('suppressed')\n}","tryCatchPattern":"try {\n    runInAction(() => mutateState())\n} catch (e) {\n    // root-cause: this is the error whose report was suppressed in the reaction\n    console.error('Causing action failed — fix this, not the suppressed warning', e)\n    throw e\n}","preventionTips":["Always read the FIRST logged error above the suppression warning","Handle promise rejections inside reaction callbacks","Validate inputs in actions before mutating observable state","Use disableErrorBoundaries temporarily in dev to get untruncated stacks"],"tags":["mobx","reaction","error-suppression","console-warning"],"backgroundTag":"suppressed-reaction-error","analyzedSha":"01211a698b64ea94de8e5f276ff8235fcf8ddf96","analyzedAt":"2026-08-28T22:10:08.831Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}