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
[6.3.0rc-8] Controls not inheriting args from url. #15278
Comments
Can you please create a reproduction by running Also, do you happen to be using the |
I am not using storybook-builder-vite. Can I send you a repro using |
@TheComputerM that's basically what |
Here is repro: https://github.com/TheComputerM/url-params-storybook |
The way the options are configured is deprecated (see console), but correcting it did not help. Need to look into this. |
Gadzooks!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-alpha.0 containing PR #15332 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Thank you very much @shilman. |
@shilman , @ghengeveld Just tested this out in storybook 6.4.0 alpha, still getting the same error. Even reinstalled the node_modules folder. |
@ghengeveld can you check out the repro above with 6.4 and let me know what you find? |
With that repo, after upgrading with |
Jiminy cricket!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.3.1 containing PR #15332 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
this is still present in 6.3.6. I reproduced this in an export const Component = <div>hi</div>
export const Template = (args) => {
console.log(args);
return (
<div>hi</div>
);
};
<Meta
title="Bug"
component={Component}
argTypes={{
allowedPageSizes: {
options: ["custom", "undefined"],
control: { type: "radio" },
mapping: {
undefined: undefined,
custom: [5, 20, 50],
},
},
}}
/>
<Canvas>
<Story name="testing">{Template.bind({})}</Story>
</Canvas> With that story I don't see the bug. The component in question has several parameters. I set the args for callbacks to dummy values, and that didn't help. I don't see any error messages This is a hard blocker for us upgrading to version 7. We use the knobs plugin to open up stories in new windows and run cypress tests against them for integration tests. We cannot migrate our system over to controls in preparation for storybook 7 unless this is isolated and fixed. I see this is part of the 6.4 milestones and help is wanted. Is there any more information on the status of this bug? |
@tmeasday is this also an issue you looked into, or am I confusing it with another high priority URL issue? |
I haven't looked into this issue specifically. I suspect the issue might be in the fact that we check the value for the arg in the URL matches up with the arg type, and there may be a bug here. What does the inferred argType look like in this case? This code is being refactored in 6.4, but I think the basic mechanism is the same, so if there is a bug in what it is doing it will likely need to be fixed. |
How would I determine what the inferred argType looks like? allowedPageSizes is an array of numbers, but it's defined using a typescript generic. When undefined, it uses a default value of |
@cellog in a story export: export const MyStory = (args, context) => {
console.log(context.argTypes);
// normal story ...
} |
@cellog also what does a malfunctioning URL look like for you? |
the URL looks correct (same params as a functioning version) |
just noticing this part of the docs:
I think this might be what is happening - I will check now. If there is simply no error, that's a problem. At the least there should be a |
UPDATE! I figured out at least the source of the bug. If you define argTypes inside a .stories.mdx it fails. If you define them inside a .stories.tsx, it succeeds. Something about mdx transformation is what's triggering this bug. |
for us, this is great news because the solution is to migrate to using |
@cellog do you have a reproduction or even a small example of an argType declaration that works in CSF/.tsx but does not work in .mdx? |
We have the same error even in Still an issue in the latest release.
@shilman do you need any reproduction for it? |
As I see, we take initial args state here
useArgs() where
context.getStoryContext(story) which returns only default args for a story, and subscribes to story arg update here
It looks like, to fix the issue, we need to I'll submit a PR with this changes. @shilman please let me know what do you think about it. |
Boo-yah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-beta.30 containing PR #16508 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Describe the bug
The args in the url are not obeyed.
To Reproduce
I toggle a control named
outlined
I copy the url and paste it into another tab.
The
outlined
control is not toggled on.System
System:
OS: Windows 10 10.0.19041
CPU: (4) x64 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Binaries:
Node: 14.17.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 81.0.4044.138
Edge: Spartan (44.19041.1023.0), Chromium (91.0.864.48)
npmPackages:
@storybook/addon-a11y: ^6.3.0-rc.8 => 6.3.0-rc.8
@storybook/addon-controls: ^6.3.0-rc.8 => 6.3.0-rc.8
@storybook/addon-measure: ^1.2.4 => 1.2.4
@storybook/addon-storysource: ^6.3.0-rc.8 => 6.3.0-rc.8
@storybook/addon-svelte-csf: ^1.1.0 => 1.1.0
@storybook/addon-viewport: ^6.3.0-rc.8 => 6.3.0-rc.8
@storybook/addons: ^6.3.0-rc.8 => 6.3.0-rc.8
@storybook/svelte: ^6.3.0-rc.8 => 6.3.0-rc.8
@storybook/theming: ^6.3.0-rc.8 => 6.3.0-rc.8
┆Issue is synchronized with this Asana task by Unito
The text was updated successfully, but these errors were encountered: