slint-ui/slint · warning
No value found for variable
Error message
No value found for variable ${variable.name} in mode ${modeName} What it means
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.
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
Example fix
// before
if (value === null) { console.warn(...); continue; }
// after
if (value === null) {
exportInfo.errors.add(`Variable ${variable.name} has no value in mode ${modeName}; skipping`);
continue;
} Defensive patterns
Strategy: validation
Validate before calling
if (value === null || value === undefined) {
exportInfo.errors.add(`Variable ${variable.name} has no value in mode ${modeName}`);
continue;
} Type guard
function hasValue(v: unknown): v is string | number | boolean | object {
return v !== null && v !== undefined;
} Try / catch
try {
const formatted = formatValue(value, variable.resolvedType);
} catch (e) {
exportInfo.errors.add(`Skipping ${variable.name}@${modeName}: ${e.message}`);
continue;
} Prevention
- 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
When it happens
Trigger: exportFigmaVariablesToSeparateFiles finds value === null after mode lookup and all fallback logic for variable.name in modeName.
Common situations: 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.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- [getVariablePathString] Collection not found for variable ID
- Missing resolved data for
- Mode mismatch for variable
- Unexpected BOOLEAN value type
- Unexpected FLOAT value type
AI-assisted analysis of slint-ui/slint@bb937076de (2026-09-16).
Data as JSON: /api/errors/47f5fc47c145386a.
Report an issue: GitHub.
Appendix: source
Thrown at tools/figma-inspector/backend/utils/export-variables.ts:1043
// Use different available values for different collection modes
const valueIndex = Math.min(
collectionModeIndex,
availableValues.length - 1,
);
[foundModeId, value] =
availableValues[valueIndex];
console.warn(
`Mode mismatch for variable ${variable.name}: using fallback value from mode ${foundModeId} (index ${valueIndex}) for expected mode ${modeName}`,
);
}
}
}
// Skip if no value found at all
if (value === null) {
console.warn(
`No value found for variable ${variable.name} in mode ${modeName}`,
);
continue;
}
// Format value and resolve all references immediately
let formattedValue = "";
let comment: string | undefined;
// Process different variable types (COLOR, FLOAT, STRING, BOOLEAN)
if (variable.resolvedType === "COLOR") {
if (
typeof value === "object" &&
value &&
"r" in value
) {
formattedValue = rgbToHex({
r: value.r,View on GitHub (pinned to bb937076de)