{"record":{"id":"bd6b52ff3fd0b8a2","repo":"mobxjs/mobx","slug":"mobx-undecorate-msg-at-fileinfo-path","errorCode":null,"errorMessage":"[mobx:undecorate] ${msg} at (${fileInfo.path})\n","messagePattern":"\\[mobx:undecorate\\] (.+?) at \\((.+?)\\)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/mobx-undecorate/src/undecorate.ts","lineNumber":540,"sourceCode":"    }\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":522,"sourceCodeEnd":544,"githubUrl":"https://github.com/mobxjs/mobx/blob/01211a698b64ea94de8e5f276ff8235fcf8ddf96/packages/mobx-undecorate/src/undecorate.ts#L522-L544","documentation":"Fallback format of the codemod's `warn` helper used when the AST node has no location info (`node.loc` is null): it prints the message with only the file path, no line/column or source excerpt.","triggerScenarios":"A warn() is triggered for a node lacking `loc` — typically programmatically generated nodes, or output of prior transforms that dropped position data.","commonSituations":"Running the codemod on machine-generated code, ASTs already partially transformed, or code produced by other codemods that stripped source locations.","solutions":["Search the named file for the construct described in the msg (e.g. all decorate calls) and fix the underlying issue.","Regenerate the source with location info, or run the codemod on the original hand-written source.","Fix the issue then re-run to confirm the warning disappears."],"exampleFix":"// before\ndecorate(Store)  // generated node without loc\n// after\ndecorate(Store, { count: observable })","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await runCodemod(files)\n} catch (e) {\n  console.error('Codemod failed on generated code without location info; run it on original sources instead')\n}","preventionTips":["Run the codemod on original hand-written sources, not generated output","Keep source maps/locations intact by running codemods before other transforms","Grep files for remaining `decorate(` calls when warnings lack line numbers"],"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"}