{"record":{"id":"47f5fc47c145386a","repo":"slint-ui/slint","slug":"no-value-found-for-variable-variable-name-in-mode-modename","errorCode":null,"errorMessage":"No value found for variable ${variable.name} in mode ${modeName}","messagePattern":"No value found for variable (.+?) in mode (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"tools/figma-inspector/backend/utils/export-variables.ts","lineNumber":1043,"sourceCode":"\n                                    // Use different available values for different collection modes\n                                    const valueIndex = Math.min(\n                                        collectionModeIndex,\n                                        availableValues.length - 1,\n                                    );\n                                    [foundModeId, value] =\n                                        availableValues[valueIndex];\n\n                                    console.warn(\n                                        `Mode mismatch for variable ${variable.name}: using fallback value from mode ${foundModeId} (index ${valueIndex}) for expected mode ${modeName}`,\n                                    );\n                                }\n                            }\n                        }\n\n                        // Skip if no value found at all\n                        if (value === null) {\n                            console.warn(\n                                `No value found for variable ${variable.name} in mode ${modeName}`,\n                            );\n                            continue;\n                        }\n\n                        // Format value and resolve all references immediately\n                        let formattedValue = \"\";\n                        let comment: string | undefined;\n\n                        // Process different variable types (COLOR, FLOAT, STRING, BOOLEAN)\n                        if (variable.resolvedType === \"COLOR\") {\n                            if (\n                                typeof value === \"object\" &&\n                                value &&\n                                \"r\" in value\n                            ) {\n                                formattedValue = rgbToHex({\n                                    r: value.r,","sourceCodeStart":1025,"sourceCodeEnd":1061,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/tools/figma-inspector/backend/utils/export-variables.ts#L1025-L1061","documentation":"During Figma variable export, no value at all could be found for the variable in the requested mode - not even a fallback. The exporter skips the variable for that mode entirely (continue), so it will be absent from the output file.","triggerScenarios":"exportFigmaVariablesToSeparateFiles finds value === null after mode lookup and all fallback logic for variable.name in modeName.","commonSituations":"Variable has an empty/unset value in that mode; the variable was deleted or unpublished in Figma after the snapshot; collection mode id mismatch means neither exact nor fallback lookup succeeded.","solutions":["Verify the variable has values set for all modes in the Figma editor","Refresh the variable snapshot (re-fetch from the Figma API/plugin) before exporting","Check the modeName/mode id mapping matches the collection's published modes","Remove or fix the offending variable in Figma, then re-export"],"exampleFix":"// before\nif (value === null) { console.warn(...); continue; }\n// after\nif (value === null) {\n  exportInfo.errors.add(`Variable ${variable.name} has no value in mode ${modeName}; skipping`);\n  continue;\n}","handlingStrategy":"validation","validationCode":"if (value === null || value === undefined) {\n  exportInfo.errors.add(`Variable ${variable.name} has no value in mode ${modeName}`);\n  continue;\n}","typeGuard":"function hasValue(v: unknown): v is string | number | boolean | object {\n  return v !== null && v !== undefined;\n}","tryCatchPattern":"try {\n  const formatted = formatValue(value, variable.resolvedType);\n} catch (e) {\n  exportInfo.errors.add(`Skipping ${variable.name}@${modeName}: ${e.message}`);\n  continue;\n}","preventionTips":["Set values for every mode of every variable in Figma before exporting","Re-fetch variables from the API to avoid stale snapshots","Collect skipped variables in an errors/warnings set for post-export review"],"tags":["figma","variables","missing-value"],"backgroundTag":"empty-result-set","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"}