{"record":{"id":"ea0798ade7111353","repo":"slint-ui/slint","slug":"missing-resolved-data-for-rownamekey-in-single-mode","errorCode":null,"errorMessage":"Missing resolved data for ${rowNameKey} in single mode ${singleModeName}","messagePattern":"Missing resolved data for (.+?) in single mode (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"tools/figma-inspector/backend/utils/export-variables.ts","lineNumber":451,"sourceCode":"                                instance.modeData!.set(modeName, {\n                                    value: \"#FF00FF\",\n                                    comment: `Missing data for mode ${modeName}`,\n                                });\n                            }\n                        }\n                    } else {\n                        // Single mode\n                        const singleModeName =\n                            [...collectionData.modes][0] || \"value\";\n                        const resolvedData =\n                            resolvedVariableModesMap.get(singleModeName);\n                        if (resolvedData) {\n                            instance.modeData!.set(singleModeName, {\n                                value: resolvedData.value,\n                                comment: resolvedData.comment, // <<< Use resolved comment >>>\n                            });\n                        } else {\n                            console.warn(\n                                `Missing resolved data for ${rowNameKey} in single mode ${singleModeName}`,\n                            );\n                            instance.modeData!.set(singleModeName, {\n                                value: \"#FF00FF\",\n                                comment: `Missing data for mode ${singleModeName}`,\n                            });\n                        }\n                    }\n\n                    propertyInstances.set(sanitizedChildName, instance);\n                }\n            }\n            return;\n        }\n\n        // For non-root nodes\n        const pathKey: string = path.join(\"/\");\n        if (!propertyInstances.has(pathKey)) {","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/tools/figma-inspector/backend/utils/export-variables.ts#L433-L469","documentation":"In the figma-inspector backend, buildInstanceModel resolves color-variable data for each row/mode. When a row's resolved data is absent in 'single mode' generation, it logs this warning and substitutes a magenta placeholder (#FF00FF) with an explanatory comment instead of failing. The library throws it to surface a data-mapping gap in the Figma export while still producing usable output that visibly flags the missing value.","triggerScenarios":"generateStructsAndInstances calls buildInstanceModel in single mode and the lookup of resolvedData for rowNameKey under singleModeName returns undefined — e.g. the Figma variable collection has no value for that mode, or the variable ID referenced by the row was not present in the resolved-data map.","commonSituations":"A Figma file where a variable mode was added after the row data was exported; a variable deleted or renamed in Figma while cached/filtered resolved data still references it; publishing a collection where not every mode defines a value for every variable.","solutions":["Re-export/refresh the Figma variable data so every mode has resolved data for every row","Check the Figma collection for variables with missing mode values and fill them in","Inspect why resolvedData lookup fails (key mismatch between rowNameKey and the resolved-data map) and fix the key construction","If intentional, suppress/expect the warning and rely on the #FF00FF placeholder in the generated Slint output"],"exampleFix":"// before: silently produces placeholder\ninstance.modeData!.set(singleModeName, { value: \"#FF00FF\", ... });\n// after: fail fast on incomplete data\nif (!resolvedData) {\n  throw new Error(`No resolved data for ${rowNameKey} in single mode ${singleModeName}`);\n}","handlingStrategy":"validation","validationCode":"const missing = rows.flatMap(r => singleModes.filter(m => !resolvedDataMap.get(key(r, m)))).map(([r, m]) => `${r}/${m}`);\nif (missing.length) console.warn(`Modes without resolved data before export:`, missing);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure every Figma variable has values for every mode before exporting","Refresh resolved data from the Figma API right before generating instances","Add a pre-export completeness check over the resolved-data map","Search generated output for #FF00FF placeholders in review"],"tags":["figma","export","missing-data","variables"],"backgroundTag":"record-not-found","analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}