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

start-storybook: Allow passing node flags #7923

Closed
cookch10 opened this issue Aug 29, 2019 · 8 comments
Closed

start-storybook: Allow passing node flags #7923

cookch10 opened this issue Aug 29, 2019 · 8 comments

Comments

@cookch10
Copy link

Is your feature request related to a problem? Please describe.
When using react storybook with the knobs addon, some stories which have a large / complex props / json structure can cause the URL length to go beyond the maximum value defined by node, which causes the local dev server to respond with an error. The solution I have found is to pass the --max-http-header-size flag to node with an appropriate value, which mitigates this issue. Unfortunately it doesn't seem like calling start-storybook allows passing any parameters other than those for storybook.

For example, changing start-storybook.cmd to look like the following solves the issue:

@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe" --max-http-header-size 90000  "%~dp0\..\@storybook\react\bin\index.js" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node --max-http-header-size 90000  "%~dp0\..\@storybook\react\bin\index.js" %*
)

Describe the solution you'd like
Would it be possible to update start-storybook to allow passing non-storybook parameters / flags?

Describe alternatives you've considered
I am welcome to any alternative approaches which could solve the issue.

Additional context:
I'm on Windows 7 x64 OS with Node v10.16.0 and npm v6.10.1

Resources:
nodejs/node#24692
https://github.com/nodejs/node/blob/master/src/node_options.h#L198

@shilman
Copy link
Member

shilman commented Aug 30, 2019

@cookch10 What version of storybook are you using?

@cookch10
Copy link
Author

cookch10 commented Sep 3, 2019

@shilman , @storybook/react version 3.4.12.

@shilman
Copy link
Member

shilman commented Sep 3, 2019

@cookch10 if you upgrade to v5 we've shortened the URL structure, which might be a workaround. i think yours is a reasonable feature request tho.

@cookch10
Copy link
Author

cookch10 commented Sep 4, 2019

Thanks @shilman , that's helpful, but doesn't solve the issue for me in all cases. Looking forward to this future enhancement!

@stale stale bot added the inactive label Sep 25, 2019
@stale stale bot closed this as completed Oct 25, 2019
@shilman shilman reopened this Oct 26, 2019
@stale stale bot removed the inactive label Oct 26, 2019
@storybookjs storybookjs deleted a comment from stale bot Oct 26, 2019
@storybookjs storybookjs deleted a comment from stale bot Oct 26, 2019
@github-actions
Copy link
Contributor

Automention: Hey @Keraito, you've been tagged! Can you give a hand here?

@sanchitbansal10
Copy link

@shilman
Is this open. I would love to work on it.
I am new to storybook..would be great if u have any pre-thought on the possible approach and can share that.

@sdkdeepa
Copy link

Hello, I would like to work on this enhancement. Please let me know.

@ndelangen
Copy link
Member

I recommend importing @storybook/core-server directly and calling it's APIs if you find that somehow the CLI isn's giving you enough flexibility.

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