question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Addon-controls: Warn if docs preset is run after controls

See original GitHub issue

Addon-controls requires addon-docs and also requires that its preset is run earlier in the main.js addons array. We should check for this automatically and warn if its misconfigured because people might not see this in the docs.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
bekapodcommented, Aug 18, 2020

👋 I am running into this warning as well, I am using a self-created preset which looks like: ['@storybook/addon-essentials', '@storybook/addon-a11y'] and my app configuration is just ['my-preset'].

After doing some digging, I see that the checker only ever receives my app configuration rather than the preset config. This means the indexOf’s return -1 rather than >= 0 (because neither controls, docs or essentials is explicitly listed in my app).

I’m not sure what the solution is though 😦 - would it be expected that the checker resolve my-preset to figure out if that’s loading the presets in the correct order?

2reactions
shilmancommented, Jul 21, 2021

@benbender it’s a complicated system and we’ll overhaul it at some point soon.

what’s going on is that there’s a whole pipeline of argType inference that happens at startup time. this includes args that the user provides, e.g. args: { a: 3 } => "there’s an arg called a that’s a number. there’s also metadata that’s extracted from the source code of the default.component. and finally, if the user manually specifies argTypes, those take precedence. there are even a few more steps that i’m omitting for clarity.

for historical reasons, addon-docs is responsible for the default.component analysis. this is why we expect that to happen before the controls addon consumes the results. in the next iteration (hopefully in 6.4), that analysis will happen outside of addon-docs, and that weird inter-addon dependency won’t be necessary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Controls - Storybook - JS.ORG
Storybook Controls gives you a graphical UI to interact with a component's arguments dynamically without needing to code. It creates an addon panel...
Read more >
@storybook/addon-controls | Yarn - Package Manager
Storybook Controls gives you a graphical UI to interact with a component's arguments dynamically, without needing to code. It creates an addon panel...
Read more >
Storybook Failed in Very First Try in New Create-React-App
I just created new react app with create-react-app and run npm start . ... '@storybook/addon-controls' (or '@storybook/addon-essentials') in ...
Read more >
@storybook/addon-controls - npm
Start using @storybook/addon-controls in your project by running `npm i ... Expanded: show property documentation; Hide NoControls warning.
Read more >
Source code for pyxbmct.addoncontrols
[docs]class ControlWithConnectCallback(object if _XBMC4XBOX else ... int, int) -> None """ Called after the control has been placed in a Window or Group....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found