{"record":{"id":"7bdb07de9aa0a616","repo":"mobxjs/mobx","slug":"mobx-undecorate-msg-at-fileinfo-path-no","errorCode":null,"errorMessage":"[mobx:undecorate] ${msg} at (${fileInfo.path}:${node.loc.start.line}:${node.loc.start.column}):\n\t${shortline}\n\t${pad}","messagePattern":"\\[mobx:undecorate\\] (.+?) at \\((.+?):(.+?):(.+?)\\):\n\t(.+?)\n\t(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/mobx-undecorate/src/undecorate.ts","lineNumber":531,"sourceCode":"            j.ClassMethod.assert(c)\n            const firstStatement = c.body.body[0]\n            const hasSuper =\n                firstStatement &&\n                j.ExpressionStatement.check(firstStatement) &&\n                j.CallExpression.check(firstStatement.expression) &&\n                j.Super.check(firstStatement.expression.callee)\n            c.body.body.splice(hasSuper ? 1 : 0, 0, initializeObservablesCall)\n        }\n    }\n\n    function warn(msg: string, node: Node) {\n        if (process.env.NODE_ENV === \"test\") {\n            return\n        }\n        if (node.loc) {\n            const line = lines[node.loc.start.line - 1]\n            const shortline = line.replace(/^\\s*/, \"\")\n            console.warn(\n                `[mobx:undecorate] ${msg} at (${fileInfo.path}:${node.loc.start.line}:${\n                    node.loc.start.column\n                }):\\n\\t${shortline}\\n\\t${\"^\".padStart(\n                    node.loc.start.column + 1 - line.indexOf(shortline),\n                    \" \"\n                )}\\n`\n            )\n        } else {\n            console.warn(`[mobx:undecorate] ${msg} at (${fileInfo.path})\\n`)\n        }\n    }\n}\n","sourceCodeStart":513,"sourceCodeEnd":544,"githubUrl":"https://github.com/mobxjs/mobx/blob/01211a698b64ea94de8e5f276ff8235fcf8ddf96/packages/mobx-undecorate/src/undecorate.ts#L513-L544","documentation":"This is the formatted warning the codemod's `warn` helper prints when the AST node has source location info: the message plus file, line, column, the offending source line, and a caret. It is a diagnostic wrapper — the actual reason is the `msg` from a skipped transformation (errors 20-26).","triggerScenarios":"Any warn() call where `node.loc` is defined; suppressed entirely when `process.env.NODE_ENV === \"test\"`.","commonSituations":"Running npx mobx-undecorate on a project and seeing per-file diagnostics pointing at decorators or decorate calls that could not be converted automatically.","solutions":["Read the msg and file:line in the warning, then apply the fix for the underlying issue (see errors 20-26).","Fix the reported location and re-run the codemod until no warnings remain.","Set NODE_ENV=test only to silence warnings during scripted runs, not as a real fix."],"exampleFix":"// before\n@observable @computed total = 0   // <- caret points here\n// after\nconstructor() { makeObservable(this, { total: observable }) }","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"const { execSync } = require('child_process')\ntry {\n  execSync('npx mobx-undecorate src/**/*.tsx', { stdio: 'inherit' })\n} catch (e) {\n  console.error('Codemod reported unhandled failures; fix warnings above and re-run')\n}","preventionTips":["Treat every [mobx:undecorate] warning as a manual TODO; the file is only partially converted","Run the codemod in a clean git tree so partial conversions are easy to review","Re-run the codemod until warnings are gone, then compile with strict TS to catch leftovers"],"tags":["codemod","warning-output","diagnostics","mobx-undecorate"],"backgroundTag":"codemod-skipped-unsupported-pattern","analyzedSha":"01211a698b64ea94de8e5f276ff8235fcf8ddf96","analyzedAt":"2026-08-28T22:10:08.831Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}