slint-ui/slint · warning
[generatePathNodeSnippet] Could not extract path commands…
Error message
[generatePathNodeSnippet] Could not extract path commands from SVG for node:
What it means
generatePathNodeSnippet converts a Figma VECTOR node into a Slint Path snippet. It extracts the node's SVG data and matches the `d` (path commands) attribute with a regex. When the match fails — no `d` attribute or an empty command list — this warning is logged and the generated snippet contains a placeholder comment instead of the commands property.
Solutions
- Recreate or repair the vector node in Figma so it contains actual path geometry (check the node in Figma's vector edit mode).
- Flatten/re-export the node: use Figma's Flatten command or re-draw the shape, then regenerate the snippet.
- If the shape should be simple, replace the VECTOR with a RECTANGLE/ELLIPSE so a non-path snippet is generated.
- Keep the generated `// Could not extract path commands from SVG` placeholder and fill in `commands:` manually from the SVG source.
Example fix
// generated snippet (before)
Path {
// Could not extract path commands from SVG
}
// after (manually supply commands from the SVG)
Path {
commands: "M 0 0 L 10 0 L 10 10 Z";
fill: #000000;
} Defensive patterns
Strategy: validation
Validate before calling
const svg = sceneNode.type === 'VECTOR' ? await (sceneNode).exportAsync({ format: 'SVG_STRING' }) : null;
const d = svg?.match(/d="([^"]*)"/)?.[1];
if (!d) console.warn(`Node ${sceneNode.id} has no path commands; snippet will contain a placeholder`); Type guard
function hasPathCommands(node: SceneNode): node is VectorNode {
return node.type === 'VECTOR';
} Prevention
- Check the vector node's geometry in Figma before exporting; empty vectors produce no `d` attribute.
- Flatten complex boolean-operation results so they carry real path data.
- Post-process generated snippets: search for the 'Could not extract path commands' placeholder and fix those nodes manually.
When it happens
Trigger: Calling generatePathNodeSnippet (via generateSlintSnippet on a node of type VECTOR, or the snippet command) on a vector node whose vectorNetwork/svg data has no parsable `d` attribute — e.g. an empty vector, a vector with only fills/strokes but no path geometry, or an SVG payload shape the regex doesn't expect.
Common situations: Inspecting Figma files with flattened boolean operations that produced empty path data; vector nodes created from images or plugins that have no real path commands; copy-pasting or exporting SVG in an unexpected format.
Related errors
- Could not fetch variable
- Could not locate the configured slint-lsp server binary in…
- Failed to convert path to URL
- [getVariablePathString] Collection not found for variable ID
- Missing fill colors for solid color value
AI-assisted analysis of slint-ui/slint@bb937076de (2026-09-16).
Data as JSON: /api/errors/d1afbd27a44075ef.
Report an issue: GitHub.
Appendix: source
Thrown at tools/figma-inspector/backend/utils/property-parsing.ts:781
);
}
break;
case "commands":
if (sceneNode.type === "VECTOR") {
try {
const svgString = await sceneNode.exportAsync({
format: "SVG_STRING",
});
const match = svgString.match(
/<path[^>]*d=(["'])(.*?)\1/,
);
if (match && match[2]) {
const pathCommands = match[2];
properties.push(
`${indentation}commands: "${pathCommands}";`,
);
} else {
console.warn(
"[generatePathNodeSnippet] Could not extract path commands from SVG for node:",
sceneNode.id,
);
properties.push(
`${indentation}// Could not extract path commands from SVG`,
);
}
} catch (e) {
console.error(
"[generatePathNodeSnippet] Error exporting SVG for node:",
sceneNode.id,
e,
);
properties.push(
`${indentation}// Error exporting SVG: ${e instanceof Error ? e.message : e}`,
);
}
}View on GitHub (pinned to bb937076de)