{"record":{"id":"c5aaf0e1654bc6f9","repo":"mobxjs/mobx","slug":"mobx-minified-error-nr-error-args-length","errorCode":null,"errorMessage":"[MobX] minified error nr: ${error}${args.length ? \" \" + args.map(String).join(\",\") : \"\"}. See mobx.js.org/errors","messagePattern":"\\[MobX\\] minified error nr: (.+?)(.+?)\\. See mobx\\.js\\.org/errors","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/mobx/src/errors.ts","lineNumber":99,"sourceCode":"        return (\n            `Cannot apply '${annotationType}' to '${name}' (kind: ${kind}):` +\n            `\\n'${annotationType}' can only be used on properties with a function value.`\n        )\n    },\n    44(annotationType) {\n        return `'${annotationType}' can only be used with 'makeObservable'`\n    }\n} as const\n\nconst errors: typeof niceErrors = __DEV__ ? niceErrors : ({} as any)\n\nexport function die(error: string | keyof typeof errors, ...args: any[]): never {\n    if (__DEV__) {\n        let e: any = typeof error === \"string\" ? error : errors[error]\n        if (typeof e === \"function\") e = e.apply(null, args as any)\n        throw new Error(`[MobX] ${e}`)\n    }\n    throw new Error(\n        `[MobX] minified error nr: ${error}${\n            args.length ? \" \" + args.map(String).join(\",\") : \"\"\n        }. See mobx.js.org/errors`\n    )\n}\n","sourceCodeStart":81,"sourceCodeEnd":105,"githubUrl":"https://github.com/mobxjs/mobx/blob/01211a698b64ea94de8e5f276ff8235fcf8ddf96/packages/mobx/src/errors.ts#L81-L105","documentation":"This is the production-mode branch of MobX's die(): when __DEV__ is false, MobX throws a deliberately terse 'minified error nr' message containing only the numeric error code and raw arguments, pointing to mobx.js.org/errors. The full explanation is stripped to keep the bundle small, so the code itself is the diagnostic.","triggerScenarios":"Any MobX invariant violation (same set as the dev-mode die) occurring in a production build: e.g. invalid autorun/reaction/computed arguments, wrong decorator targets via assert20223DecoratorType, invalid extendObservable usage — but with the descriptive message compiled out.","commonSituations":"Bundling with NODE_ENV=production and hitting an invariant that developers only see as a code number; CI/e2e environments running prod builds; trying to read prod error output without the errors table.","solutions":["Reproduce locally with a development build (NODE_ENV=development) to get the full message","Take the number after 'minified error nr:' and look it up at mobx.js.org/errors or in packages/mobx/src/errors.ts niceErrors table","Search the codebase for the failing API call once the code is decoded and fix the invariant violation","Enable source maps and stack traces in prod monitoring to locate the throwing call site"],"exampleFix":"// before (prod output)\nError: [MobX] minified error nr: 12. See mobx.js.org/errors\n// after (debug locally)\nNODE_ENV=development npm run dev  # full message: [MobX] <detailed explanation>","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"function isMinifiedMobxError(e: unknown): e is Error {\n    return e instanceof Error && e.message.startsWith('[MobX] minified error nr:')\n}","tryCatchPattern":"try {\n    runReaction()\n} catch (e) {\n    if (e instanceof Error && e.message.startsWith('[MobX] minified error nr:')) {\n        const nr = e.message.match(/nr:\\s*(\\S+)/)?.[1]\n        console.error(`MobX prod error ${nr} — decode at mobx.js.org/errors`)\n    } else throw e\n}","preventionTips":["Test critical flows with development builds where full messages are thrown","Keep a map of niceErrors (packages/mobx/src/errors.ts) handy for prod triage","Enable source maps in error monitoring to find call sites","Reproduce prod-only failures locally with NODE_ENV=production but unminified bundles"],"tags":["mobx","minified","production","error-codes"],"backgroundTag":"mobx-minified-error-code","analyzedSha":"01211a698b64ea94de8e5f276ff8235fcf8ddf96","analyzedAt":"2026-08-28T22:10:08.831Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}