Repository navigation
Conversation
The Icon regex stopped at the first '/', so color="var:color/fg" dropped the icon silently. Quoted values (single or double) may now contain '/', parseProps reads single-quoted values, and an <Icon> tag that still cannot be parsed throws instead of vanishing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The single-render wrapper declared the root frame with const inside the try block, so the catch could not see it: frame.remove() threw a ReferenceError that replaced the real message (e.g. a missing variant) and skipped the cleanup, leaving half-built frames on the canvas. The frame is now declared before the try, removed when present, and the original error is rethrown with its node context. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The flex-wrapper auto-split turned any layout-only <Frame> with 2+ <Frame>
children into standalone canvas items. That broke real structure: children
with w="fill", h="fill" or grow lost the parent they size against, and a
variant-named frame ("Type=desktop-screens, Size=desktop") became its
first row. Both cases now keep the wrapper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A timeout does not stop code that is already running in Figma, but three places treated it as "nothing happened": - render sent its generated code through the daemon's eval action and got the 30s eval budget instead of the render one; it now asks for 90s. - daemonExec relabelled every error containing "timeout" with its own 90s and "Try reconnecting", so a 30s daemon limit read as 90s. - the eval command and fastEval fell back to the direct connection on a timeout and ran the same code again, which duplicated whatever the first run was still building. Timeouts now keep their real budget, say the command may still finish, and never trigger a second run. The daemon's eval accepts a bounded timeoutMs for long, mutating callers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
silships
pushed a commit
that referenced
this pull request
Nov 19, 2026
…e-runs (#59) Ported from PR #59 by hakamfaza onto current main: - <Icon> tags with "/" in quoted values no longer vanish; parseProps reads single quotes - render catch block no longer masks errors as "frame is not defined" and removes the partial frame - auto-split keeps wrappers whose children fill/grow, and variant-named frames - timeouts: render gets the 90s budget, daemonExec keeps the real budget, eval/fastEval never re-run code after a timeout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
silships
pushed a commit
that referenced
this pull request
Nov 19, 2026
Ported from PR #43 by clementcopper onto current main. The catch-block unmasking half of #43 already landed with #59, so only the fill sizing is ported here: - root frame w/h="fill" is set after appendChild when --parent is an auto-layout frame, warns otherwise instead of throwing - Rectangle / Ellipse / Image keep "fill" out of resize() and set layoutSizing* after appendChild (ignored in flex="none" parents) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thank you! This is in figma-cli 2.4.0 on npm: the Icon slash fix, the real render errors, the auto-split guard and the timeout handling. Commit 793485f keeps you as the author |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four render/CLI fixes found while building a full design system with
figma-cli. Each one has a test that fails before the fix and passes after it.npm test: 564/564.1.
<Icon>dropped when a quoted value contains/The Icon regex stopped at the first
/, so a slash-named variable made the whole tag disappear without an error.Repro
figma-cli render '<Frame name="Row" flex="row"><Icon name="lucide:arrow-right" size={16} color="var:color/fg" /></Frame>'Warning: Frame has content but no elements were parsed, and an empty frame.color/fg.Fix: quoted values (single or double) may contain
/.parsePropsreads single-quoted values. An<Icon>tag that still can't be parsed throws instead of vanishing.Tests:
tests/figma-client.test.js("<Icon>attributes containing slashes").2. Every render error reported as
ReferenceError: frame is not definedThe single-render wrapper declared
const frameinside thetryblock and calledframe.remove()in thecatchblock, whereframeis out of scope. The ReferenceError replaced the real message and skipped the cleanup, so half-built frames stayed on the canvas.Repro (any component set without the requested variant):
figma-cli render '<Frame name="T"><Instance component="Tag" variant="State=does-not-exist" /></Frame>'✗ Render failed: ReferenceError: frame is not defined, and a partial frame is left behind.No variant of "Tag" matches {"State":"does-not-exist"}. Axes: State=default|hover|active, and the partial frame is removed.Fix: declare the frame before the
tryblock, remove it if it exists, and rethrow the original error with its node context.Tests:
tests/render-error-path.test.jsruns the generated render code in anode:vmsandbox against a mock component set.tests/flex-none.test.jsgets a one-line anchor update.3. Auto-split breaks wrappers whose children fill them
detectWrapperSplitturned any layout-only<Frame>with two or more<Frame>children into separate canvas items. That breaks real structure:w="fill",h="fill"orgrowlose the parent they size against.Type=grid, Size=desktop) becomes only its first row.Repro
figma-cli render '<Frame name="Gallery" w={600} flex="col" gap={24}><Frame name="Row" w="fill" flex="row"><Frame w={100} h={50} bg="#000" /></Frame><Frame name="Row" w="fill" flex="row"><Frame w={100} h={50} bg="#000" /></Frame></Frame>'↳ outer flex wrapper detected — splitting to 2 standalone items. The two rows land on the canvas without theGalleryframe.Galleryframe with both rows inside.Fix: don't split when a direct child fills or grows, or when the outer frame is variant-named. The "N cards in a bag" split is unchanged.
Tests:
tests/wrapper-split.test.js.4. Timeouts hide their cause and re-run code that is still executing
Code sent to Figma keeps running after the caller stops waiting, but three places treated a timeout as "nothing happened":
rendersends its generated code through the daemon'sevalaction, so it got the 30s eval budget, never the 90s render budget.daemonExecrelabelled every error containing "timeout" asExecution timeout (90s). Try reconnecting. A 30s daemon limit read as 90s.figma-cli evalandfastEvalfell back to the direct connection on a timeout and ran the same code again. That duplicated whatever the first run was still building.Repro
Execution timeout (90s). Try reconnecting.⚠ Daemon error, trying sync path....__runsis2: the code ran twice.Figma did not answer within 30s. The command may still be running in Figma and finish on its own: check the canvas before running it again.__runsis1.Fix:
src/lib/timeouts.jsholds the shared policy: error classification, the message, and a clamped budget.evalaccepts a boundedtimeoutMs, andrenderasks for 90s.daemonExeconly relabels its own abort.Tests:
tests/timeouts.test.js. ThedaemonExeccase stubsfetchand fails against the oldcli-core.js.Live checks, Figma Desktop 126.9 in Yolo mode:
🤖 Generated with Claude Code