{"record":{"id":"780dd6f912ec5d85","repo":"slint-ui/slint","slug":"unknown-fill-type","errorCode":null,"errorMessage":"Unknown fill type:","messagePattern":"Unknown fill type:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"tools/figma-inspector/backend/utils/property-parsing.ts","lineNumber":340,"sourceCode":"            }\n            return generateLinearGradient({\n                opacity: opacity,\n                gradientStops: fill.gradientStops,\n                gradientTransform: fill.gradientTransform,\n            });\n        }\n        case \"GRADIENT_RADIAL\": {\n            if (!fill.gradientStops || !fill.gradientTransform) {\n                return \"\";\n            }\n            return generateRadialGradient({\n                opacity: opacity,\n                gradientStops: fill.gradientStops,\n                gradientTransform: fill.gradientTransform,\n            });\n        }\n        default: {\n            console.warn(\"Unknown fill type:\", fill.type);\n            return null;\n        }\n    }\n}\n\nasync function getVariablePathString(\n    variableId: string,\n): Promise<string | null> {\n    const variable = await figma.variables.getVariableByIdAsync(variableId);\n    if (variable) {\n        const collection = await figma.variables.getVariableCollectionByIdAsync(\n            variable.variableCollectionId,\n        );\n        if (collection) {\n            const globalName = formatStructName(collection.name);\n            const pathParts = extractHierarchy(variable.name);\n            const slintPath = pathParts.map(sanitizePropertyName).join(\".\");\n            let resultPath = \"\";","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/tools/figma-inspector/backend/utils/property-parsing.ts#L322-L358","documentation":"getBrush received a fill whose paint type is not one of the handled cases (SOLID, GRADIENT_LINEAR, ...). The default branch warns with the unknown type and returns null, so this fill is skipped in the generated snippet.","triggerScenarios":"A Figma node's paints include an unhandled type such as GRADIENT_RADIAL, GRADIENT_ANGULAR, GRADIENT_DIAMOND, IMAGE, or a new/unknown paint type returned by the API.","commonSituations":"Nodes with image fills or radial/angular gradients exported through the snippet generators; Figma adding a new paint type the plugin hasn't been updated to support.","solutions":["Extend getBrush with handlers for the missing paint types (e.g. GRADIENT_RADIAL, GRADIENT_ANGULAR, IMAGE)","Pre-filter fills before calling getBrush so unsupported paint types are skipped silently or reported once","Check the Figma plugin/REST API changelog for newly added paint types","Fall back to the nearest supported representation (e.g. average stop color for unhandled gradients) if exact fidelity is not required"],"exampleFix":"// before\ncase \"GRADIENT_LINEAR\": { ... }\ndefault: { console.warn(\"Unknown fill type:\", fill.type); return null; }\n// after\ncase \"GRADIENT_RADIAL\":\n    return generateRadialGradient(fill);\ncase \"IMAGE\":\n    return null; // intentionally unsupported\ndefault: {\n    console.warn(\"Unknown fill type:\", fill.type);\n    return null;\n}","handlingStrategy":"fallback","validationCode":"const handled = [\"SOLID\", \"GRADIENT_LINEAR\"];\nif (!handled.includes(fill.type)) { reportUnsupported(fill.type); }","typeGuard":"function isKnownFillType(t: string): t is \"SOLID\" | \"GRADIENT_LINEAR\" {\n  return handled.includes(t as any);\n}","tryCatchPattern":"try {\n  brush = getBrush(fill);\n} catch (e) {\n  brush = fallbackBrushFor(fill);\n}","preventionTips":["Enumerate Figma paint types (radial/angular gradients, image fills) and handle or explicitly skip each","Filter fills before invoking getBrush","Keep a supported-types whitelist in sync with the Figma plugin API changelog"],"tags":["figma","brush","unsupported-type"],"backgroundTag":"unsupported-enum-value","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"}