storybookjs / storybook

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

[Bug]: #20137

Closed mnrendra closed 1 year ago

mnrendra commented 1 year ago

Describe the bug

Error when running npm run storybook or yarn storybook
where the script in package.json is like this:

{
  "scripts": {
    "storybook": "start-storybook -p 6006",
  }
}
Screenshot 2022-12-07 at 11 04 10 PM

It solved by adding export SET NODE_OPTIONS=--openssl-legacy-provider in the script:

{
  "scripts": {
    "storybook": "export SET NODE_OPTIONS=--openssl-legacy-provider && start-storybook -p 6006",
  }
}

But doesn't work when running on Chromatic Github Action.

Screenshot 2022-12-07 at 11 19 59 PM

Note:

To Reproduce

repository: https://github.com/mnrendra/particleui
deployed reproduction: https://github.com/mnrendra/particleui/actions/runs/3640086691/jobs/6144298287

System

Environment Info:

  System:
    OS: macOS 13.0.1
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: 3.2.4 - ~/.nvm/versions/node/v18.12.1/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Chrome: 108.0.5359.94
    Safari: 16.1
  npmPackages:
    @storybook/addon-actions: ^6.5.14 => 6.5.14 
    @storybook/addon-essentials: ^6.5.14 => 6.5.14 
    @storybook/addon-interactions: ^6.5.14 => 6.5.14 
    @storybook/addon-links: ^6.5.14 => 6.5.14 
    @storybook/builder-vite: ^0.2.5 => 0.2.5 
    @storybook/react: ^6.5.14 => 6.5.14 
    @storybook/testing-library: ^0.0.13 => 0.0.13

Additional context

No response

IanVS commented 1 year ago

Node 18 is not supported with @storybook 6.5 when using builder-vite. If you'd like to run with node 18 and the vite builder, I suggest upgrading to storybook 7. You can use npx sb@next upgrade --prerelease, and check out https://github.com/storybookjs/storybook/blob/next/MIGRATION.md for the details on what has changed.