storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.22k stars 9.26k forks source link

Storybook disregarding "framework" setting if both "@storybook/react" and "@storybook/vue3" are installed #17675

Closed alexgrozav closed 2 years ago

alexgrozav commented 2 years ago

Describe the bug I have a storybook setup where I'm planning to switch between Vue and React using an environment variable.

If I have both @storybook/vue3 and @storybook/react installed, the most recently installed one will always get picked up, no matter what I set the framework config property to.

To Reproduce

  1. Create Storybook setup
  2. npm install @storybook/vue3
  3. npm install @storybook/react
  4. Set framework: '@storybook/vue3
  5. The storybook setup will run using @storybook/react

System

Environment Info:

  System:
    OS: macOS 11.4
    CPU: (4) x64 Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz
  Binaries:
    Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v14.18.1/bin/yarn
    npm: 6.14.15 - ~/.nvm/versions/node/v14.18.1/bin/npm
  Browsers:
    Chrome: 99.0.4844.51
    Safari: 14.1.1
  npmPackages:
    @storybook/addon-a11y: 6.4.19 => 6.4.19 
    @storybook/addon-actions: 6.4.19 => 6.4.19 
    @storybook/addon-essentials: 6.4.19 => 6.4.19 
    @storybook/addon-links: 6.4.19 => 6.4.19 
    @storybook/addon-postcss: 2.0.0 => 2.0.0 
    @storybook/builder-webpack5: 6.4.19 => 6.4.19 
    @storybook/manager-webpack5: 6.4.19 => 6.4.19 
    @storybook/react: 6.4.19 => 6.4.19 
    @storybook/vue3: 6.4.19 => 6.4.19 
svkd9 commented 2 years ago

because @storybook/vue3 and @storybook/react will both have the same name under the bin, and both are 'build-storybook scripts', so @storybook/react will override @storybook/vue3。 You can specify the full path to the script when you run it

alexgrozav commented 2 years ago

Didn't know that! Thank you for the help.

I'll close this for now. Hope the solution will help others encountering the same problem.