-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Addon-controls: Warn if docs preset is run after controls #11442
Comments
Yay!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-beta.46 containing PR #11458 that references this issue. Upgrade today to try it out! You can find this prerelease on the Closing this issue. Please re-open if you think there's still more to do. |
I'm seeing this error on rc.26 with the following code included in an addon's export const addons = [
'@storybook/addon-links',
{
name: '@storybook/addon-docs',
options: {
configureJSX: true,
},
},
'@storybook/addon-controls',
'@storybook/addon-backgrounds',
]; I see there's a test case with an object so not quite sure what's happening here. Haven't dug in much further. |
👋 I am running into this warning as well, I am using a self-created preset which looks like: 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? |
For everyone finding this after getting the message
What it should say: I opened a PR (#12738) to make the phrasing a bit clearer, hope that helps. |
Yo-ho-ho!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.0-alpha.24 containing PR #12738 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Ooh-la-la!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.27 containing PR #12738 that references this issue. Upgrade today to the
|
@shilman Pls reopen this bug report. To me it seems the issue hasn't been fixed at all, just the wording of the warning got adjusted. I'm facing this issue loading If I move |
Same issue as @Sapendo, I do not use essentials nor docs, yet I see the warning |
@Sapendo you have |
@shilman But I do not use |
@Sapendo addon-controls uses docgen data generated by addon-docs. It will still work without, but it can be a degraded experience. We plan to change this in a future version of docs/controls, possibly as soon as 6.4 |
@benbender updated #15625 |
@shilman Thank you very much (for your general work on storybook and for the fix)! Just to get this right: addon-controls is automatically loaded and if you either don't load addon-docs or later (via preset f.e.) you'll get the warning? |
@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. for historical reasons, |
Addon-controls
requiresaddon-docs
and also requires that its preset is run earlier in themain.js
addons
array. We should check for this automatically and warn if its misconfigured because people might not see this in the docs.The text was updated successfully, but these errors were encountered: