-
Notifications
You must be signed in to change notification settings - Fork 257
Closed
Labels
Description
Bug report
We use stitches at attentive to power our internal component library and style system, we love it, so first off, thank you! Part of what we do at attentive is render UI on our clients' sites, we recently switched to using our new internal library, powered by stitches, and ran into this circular dependency issue.
Describe the bug
When any circular dependency exists in the document, createStitches
fails
To Reproduce
I've created a code sandbox that reproduces the issue here: https://codesandbox.io/s/circular-json-reproduction-0i5lp?file=/src/App.tsx
to reproduce locally:
document.someLib = {};
document.someLib.ref = someLib;
const { styled } = createStitches({});
// ^ throws "TypeError - Converting circular structure to JSON"
Expected behavior
Should be able to handle circular JSON
Screenshots
with a circular dep:
without
System information
- OS: macOS (but will affect all)
- Browser: All
- Version of Stitches: 1.2.3
Note
Related to this issue was recently closed: #665 (comment)