-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circular json can possibly hang. #778
Comments
Also facing this problem... Wasted hours just to find out that storybook caused this. 😢 |
Also hit this issue. |
@rhalff @leMaik @jonnyelliot Any of you feel like contributing to help resolve this issue? |
@ndelangen I'd like to, but I have no idea how to fix this. 😕 |
@ndelangen I can take a look at this. |
@leMaik Here's why i thought it would be pretty simple:
Maybe you and @jonnyelliot can contact each other and resolve it together. If you need my help, just ask! 🥇 |
@jonnyelliot Is this still something you're interested in to fix? Did you get stuck somewhere? maybe I can help! |
Hey guys, is someone actively working on this? If not I can take a stab at it this weekend. |
I could have a look, no guarantees though Btw, the link in the original post should become: The current format function only test for a 'SyntheticEvent' but there are many more cases where recursion will fail: Node's build-in |
@dangreenisrael @rhalff a PR to fix this proper would be fantastic! |
Nice catch people! So i've hit this and (just like you) spent about an hour on this, to my (and may your!) salvation, moving the event to it's own argument will solve this: before: const MyAwesomeComponent = ({ onClick }) => (
<button
onClick={(event) => onClick({ event, awesome: true })}
/>
); after: const MyAwesomeComponent = ({ onClick }) => (
<button
onClick={(event) => onClick(event, { awesome: true })}
/>
); |
I think this is fixed right? |
Wednesday Nov 02, 2016 at 02:55 GMT
Originally opened as storybook-eol/storybook-addon-actions#26
It can be replicated by replacing
circular
with something likewindow
within:https://github.com/kadirahq/storybook-addon-actions/blob/master/.storybook/stories.js#L20
The click on the circular button will cause the action to never be logged.
I've tried replacing
json-stringify-safe
withcircular-json
which seems to behave better.But even then after the 4th click
circular-json
will throw a circular reference error.I now know how to circumvent this by just not logging something with circular references, however when this bug is encountered it's not immediately clear the hang originates from within storybook which makes one try to debug the application code itself first.
I think replacing json-stringify-safe with circular-json would already be an improvement.
The text was updated successfully, but these errors were encountered: