Skip to main content
ShaneHCisco
New Participant
Oct 7, 2026 8:27 PM UTC
Question

Figma Make preview's console.debug hook throws on circular objects (e.g. DOM nodes), breaking any app code that logs them

Summary:
The Make preview iframe replaces console.debug with a wrapper that calls JSON.stringify on each argument. If any argument is circular, such as a DOM element with a React fiber attached, the wrapper throws a TypeError. The exception propagates into the calling code, so a harmless debug log can break app or library logic. The same code works outside the preview, for example in a plain Vite dev server.
 

Steps to reproduce

In a Make project, run this anywhere in app code or a dependency:

const el = document.createElement('div')
// or any DOM node rendered by React, which has a __reactFiber$ property
console.debug('mounted', el)

For a minimal repro, log an object with a self-reference:
const a = {}; a.self = a
console.debug(a)
Open the Make preview and check the console.

Expected: The log is recorded or safely ignored, and execution continues.

Actual: The hook throws:

TypeError: Converting circular structure to JSON
  --> starting at object with constructor 'HTMLDivElement'
  ... property '__reactFiber$...' -> object with constructor 'FiberNode'
  --- property 'stateNode' closes the circle
  at JSON.stringify (<anonymous>)
  at Array.map (<anonymous>)
  at n (make_git_preview_ifr…min.js)
  at Object.debug (make_git_preview_ifr…min.js)
The call to console.debug throws. Any code that doesn't expect logging to fail aborts at that point.

 

Real-world impact: A third-party component library logs a DOM node with console.debug inside a try block while drawing. The exception aborted the draw, the library reported a generic render error, and the component showed as an empty panel. Nothing in the console pointed to the preview as the cause, so it was hard to diagnose.

 

Workaround:
Wrap console.debug in the app entry file:

const originalDebug = console.debug.bind(console)
console.debug = (...args) => {
  try { originalDebug(...args) } catch { /* ignore */ }
}

Environment: Figma Make preview (the make_git_preview_ifr… iframe), React 18, Vite, Chromium-based browser.

7 replies

adamsmasher
Figmate
Figmate
Oct 8, 2026 8:52 PM UTC

Thanks for the detailed report and reproduction, ​@ShaneHCisco, and for including a temporary solution. I had Figma Make build me a reproduction of this, and shared that with a bug report to the team. I’ll reply again when I have any updates I can share.

 

Did you actually see this happen with a third party component library, or are you just noting that as a way that this could end up in a Make file?

ShaneHCisco
New Participant
Oct 8, 2026 9:24 PM UTC

Thanks ​@adamsmasher . Yes I think it can happen with any but I had it happen with a real 3rd party component library and noticed it because the component from that library wasn’t rendering (then Make figured out what was going on once I provided screenshots of the console logs it prompted me for I believe - would be cool somehow if it could have read the console as well but that I suppose is a different request ha).

ShaneHCisco
New Participant
Oct 15, 2026 7:33 PM UTC

​@adamsmasher heads up I made another post talking about general error warnings I think may have a bug/room for improvement and it has been in moderation for a few days. Not sure if you can allow that one to be posted but it would be appreciated.

ShaneHCisco
New Participant
Oct 16, 2026 1:53 PM UTC

I went ahead and just tried to remake the post and it has gone through now: 

 

ShaneHCisco
New Participant
Oct 16, 2026 1:52 PM UTC

Hi team,

I reported this ~a week ago but it got caught in moderation and never released so trying again.

I am finding that in Figma Make it can often experience console errors during the initial generation of a prototype. This then shows the users the infamous “10+ errors” with the ‘fix for me’ button. Our users then come back to us (the template owners) thinking we have a bug. 

What I have found is almost always these errors were for intermediate stages of prototype generation but the final thing handed off by Make does not include these. A simple refresh of the page causes it to recalculate and often leaves something like a “3 warnings” instead (i.e. cleared the errors / big red prompt that something is wrong).

ksn
Figmate
Community Support
Oct 16, 2026 2:58 PM UTC

Hey ​@ShaneHCisco - apologies that communications have been delayed. I saw your other topic, and I merged it to the one you were originally speaking with ​@adamsmasher here. At the moment, I see they are is actually doing some investigation internally, and should be getting back to you when he learns more.

We like to keep things in one place. Thanks for your patience!

ShaneHCisco
New Participant
Oct 16, 2026 3:05 PM UTC

​@ksn it is a separate issue from this thread - it was only mentioned here to try to get help with the moderation.