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

[Bug]: Illegal value for check argType from url query params #19760

Open
ryuran opened this issue Nov 5, 2022 · 2 comments
Open

[Bug]: Illegal value for check argType from url query params #19760

ryuran opened this issue Nov 5, 2022 · 2 comments

Comments

@ryuran
Copy link

ryuran commented Nov 5, 2022

Describe the bug

@storybook/html: 6.5.13

"check" argTypes do not works in standalone iframe.

Url parsing to get args values warn Received illegal value for…

To Reproduce

Given a story with argType type "check":

export default { title: 'test' };

const template = (knobs) => `<div>${knobs.options.join(', ')}</div>`;

export const story = template.bind({});

const samplesOptions = {
  option1: 'First option',
  option2: 'Second option',
  option3: 'Third option',
};

story.args = {
  samples: [],
};

story.argTypes = {
  samples: {
    name: 'Samples',
    control: {
      type: 'check',
      labels: samplesOptions,
    },
    options: [...Object.keys(samplesOptions)],
  },
};

When the user select an option for the "samples" controls, the url iframe is :
http://localhost:6006/iframe.html?viewMode=story&id=test--story&args=samples[0]:option1;

It's properly displayed but if we open it in a new browser tab or window (using (or not) the eject button) the page log an error :

Received illegal value for 'samples[0]'. Supported options: 'option1', 'option2', 'option3'

System

Environment Info:

  System:
    OS: macOS 12.6
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
  Binaries:
    Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.13.2/bin/yarn
    npm: 8.13.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
  Browsers:
    Chrome: 107.0.5304.87
    Safari: 15.6.1

Additional context

No response

@ryuran
Copy link
Author

ryuran commented Nov 5, 2022

Maybe related to #17413

@ryuran ryuran changed the title [Bug]: Illegal value for check argType when "eject" a story [Bug]: Illegal value for check argType from url query params Nov 5, 2022
@ryuran
Copy link
Author

ryuran commented Dec 20, 2022

No new for this issue ?
I sound like a major issue.
Lot of testing tools rely on args passed by query string.

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

3 participants