storybook icon indicating copy to clipboard operation
storybook copied to clipboard

[Bug]: Objects get polluted with _constructor-name_ key

Open Haroenv opened this issue 1 year ago • 0 comments

Describe the bug

Unfortunately I can't figure out what's causing this, but some of my network requests get called with _constructor-name_: SearchParameters, which I know is the name of a class. Normally those calls should have been using JSON.stringify, and not have the contstructor name injected. I believe this could be related with https://github.com/storybookjs/telejson?

I can't reproduce this consistently, usually on a reload it doesn't occur anymore.

To Reproduce

https://github.com/algolia/instantsearch/tree/master/packages/instantsearch.js is one repo I can reproduce this in by interacting in the iframe

System

"@storybook/addon-a11y": "5.3.9",
    "@storybook/addon-actions": "5.3.9",
    "@storybook/addon-knobs": "5.3.9",
    "@storybook/addon-links": "5.3.9",
    "@storybook/addon-options": "5.3.9",
    "@storybook/addons": "5.3.9",
    "@storybook/theming": "5.3.9",

and also in individual packages

    "@storybook/html": "5.3.9",
    "@storybook/vue": "5.3.9",
    "@storybook/react": "5.3.9",

Additional context

I believe telejson might add info to objects that get logged(?) or otherwise processed by storybook, which changes its behaviour when serialising. This definitely must be conditional, maybe on hot reload, as I can't reproduce it consistently.

Haroenv avatar Mar 15 '23 15:03 Haroenv