Skip to content
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

Storybook 6.0 children args break if value is empty #10856

Closed
lifeiscontent opened this issue May 21, 2020 · 10 comments
Closed

Storybook 6.0 children args break if value is empty #10856

lifeiscontent opened this issue May 21, 2020 · 10 comments

Comments

@lifeiscontent
Copy link
Member

lifeiscontent commented May 21, 2020

Describe the bug
if I set my children arg to no value, the entire story breaks.

Screen Shot 2020-05-20 at 11 34 18 PM

@lifeiscontent lifeiscontent changed the title Storybook 6.0 Storybook 6.0 children args break if value is empty May 21, 2020
@shilman shilman added this to the 6.0 args milestone May 21, 2020
@shilman shilman self-assigned this May 28, 2020
@shilman shilman added the react label May 28, 2020
@stale stale bot added the inactive label Jun 20, 2020
@lifeiscontent
Copy link
Member Author

@shilman did this get fixed?

@stale stale bot removed the inactive label Jun 21, 2020
@storybookjs storybookjs deleted a comment from stale bot Jun 21, 2020
@shilman
Copy link
Member

shilman commented Jun 21, 2020

Not explicitly. But maybe ... there have been lots of improvements since this was filed. Can you provide a repro in official-storybook for me to look at?

@stale
Copy link

stale bot commented Jul 13, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Jul 13, 2020
@shilman shilman modified the milestones: 6.0 args, 6.1 args Jul 30, 2020
@stale stale bot removed the inactive label Jul 30, 2020
@stale
Copy link

stale bot commented Aug 22, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Aug 22, 2020
@cabello
Copy link
Contributor

cabello commented Sep 24, 2020

Hi,

Not sure if related but I saw the following issue.

The following works and renders well:

Card.args = {
  children: 'Hello',
};

The following breaks:

Card.args = {
  children: <Paragraph>Hello</Paragraph>,
};

Results in:

Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at mapValues (webpack://storybook_docs_dll//Users/shilman/projects/baseline/storybook/node_modules/lodash/mapValues.js?:34:19)
    at inferType (http://localhost:6006/vendors~main.3ac77e73d8b04b576592.bundle.js:53680:48)
    at http://localhost:6006/vendors~main.3ac77e73d8b04b576592.bundle.js:53681:14
    at eval (webpack://storybook_docs_dll//Users/shilman/projects/baseline/storybook/node_modules/lodash/mapValues.js?:38:34)
    at eval (webpack://storybook_docs_dll//Users/shilman/projects/baseline/storybook/node_modules/lodash/_createBaseFor.js?:18:11)
    at baseForOwn (webpack://storybook_docs_dll//Users/shilman/projects/baseline/storybook/node_modules/lodash/_baseForOwn.js?:14:20)
    at mapValues (webpack://storybook_docs_dll//Users/shilman/projects/baseline/storybook/node_modules/lodash/mapValues.js?:37:3)
    at inferType (http://localhost:6006/vendors~main.3ac77e73d8b04b576592.bundle.js:53680:48)
    at http://localhost:6006/vendors~main.3ac77e73d8b04b576592.bundle.js:53681:14
    at eval (webpack://storybook_docs_dll//Users/shilman/projects/baseline/storybook/node_modules/lodash/mapValues.js?:38:34)

Paragraph in this case is a styled component:

import styled from '@emotion/styled';

export const Paragraph = styled.p``

Does that help with reproduction?

🙇

@shilman
Copy link
Member

shilman commented Sep 25, 2020

@cabello currently all arg values must be JSON-serializable values

Related: #11429

@jonniebigodes i wonder whether there's a good documentation fix for this short term

@maxzirps
Copy link

maxzirps commented Nov 5, 2020

Though this works in React, this fails in Preact

export const Multi = ({hint}) => <div>{hint}</div>

export const Template = (args) => (
  <Multi
    hint={args.hint}
  />
);

<Canvas>
  <Story name="MultiBoy" args={{ hint: <div>hello</div> }}>
    {Template.bind({})}
  </Story>
</Canvas>
RangeError: Maximum call stack size exceeded
    at http://localhost:4400/vendors~main.6a07754c95c36a1d2035.bundle.js:139985:18
    at baseForOwn (http://localhost:4400/vendors~main.6a07754c95c36a1d2035.bundle.js:137923:20)
    at mapValues (http://localhost:4400/vendors~main.6a07754c95c36a1d2035.bundle.js:144489:3)
    at inferType (http://localhost:4400/vendors~main.6a07754c95c36a1d2035.bundle.js:26122:48)
    at http://localhost:4400/vendors~main.6a07754c95c36a1d2035.bundle.js:26123:14
    at http://localhost:4400/vendors~main.6a07754c95c36a1d2035.bundle.js:144490:34
    at http://localhost:4400/vendors~main.6a07754c95c36a1d2035.bundle.js:139993:11
    at baseForOwn (http://localhost:4400/vendors~main.6a07754c95c36a1d2035.bundle.js:137923:20)
    at mapValues (http://localhost:4400/vendors~main.6a07754c95c36a1d2035.bundle.js:144489:3)
    at inferType (http://localhost:4400/vendors~main.6a07754c95c36a1d2035.bundle.js:26122:48)

@shilman
Copy link
Member

shilman commented Nov 6, 2020

Arg values should be JSON serializable (ish) @maxzirps

@stale
Copy link

stale bot commented Dec 25, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Dec 25, 2020
@ghengeveld
Copy link
Member

Closing this for lack of a reproduction. I wasn't able to break Storybook by nullifying a required arg.

JSX is not supported as arg value. Use a mapping instead.

@stale stale bot removed the inactive label Mar 18, 2021
shilman added a commit that referenced this issue Jun 5, 2021
Chore: update documentation to address issue #10856
shilman added a commit that referenced this issue Jun 5, 2021
Chore: update documentation to address issue #10856
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants