storybookjs / storybook

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

Pure HTML project with DeprecationWarning #18230

Closed Aleksey-Danchin closed 1 year ago

Aleksey-Danchin commented 2 years ago

Describe the bug npx sb init --type html in empty project create not worked configuration.

To Reproduce

mkdir project
cd project
npm init -y
npx sb init --type html
npm run storybook

System Lubuntu 21.10 node 18.1 storybook 6.4.22

Terminal logs

work@work-computer:~/Desktop/project$ npm run storybook

> project@1.0.0 storybook
> start-storybook -p 6006

info @storybook/html v6.4.22
info 
info => Loading presets
info => Using implicit CSS loaders
info => Using prebuilt manager
info => Using default Webpack4 setup
(node:17827) DeprecationWarning: Default PostCSS plugins are deprecated. When switching to '@storybook/addon-postcss',
you will need to add your own plugins, such as 'postcss-flexbugs-fixes' and 'autoprefixer'.

See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-default-postcss-plugins for details.
(Use `node --trace-deprecation ...` to show where the warning was created)
10% building 1/12 modules 11 active /home/work/Desktop/project/node_modules/@storybook/addon-outline/dist/esm/preset/addDecorator.js-generated-config-entry.jsnode:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/home/work/Desktop/project/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/work/Desktop/project/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/work/Desktop/project/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/work/Desktop/project/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/work/Desktop/project/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/work/Desktop/project/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/work/Desktop/project/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at /home/work/Desktop/project/node_modules/loader-runner/lib/LoaderRunner.js:205:4 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.1.0
vandor commented 1 year ago

I ran into this issue as well. It appears to be a problem with webpack and node v17+ (see https://github.com/webpack/webpack/issues/14532)

The solution for me was to update my npm scripts for storybook and build-storybook in package.json:

    "storybook": "cross-env NODE_OPTIONS='--openssl-legacy-provider' start-storybook",
    "build-storybook": "cross-env NODE_OPTIONS='--openssl-legacy-provider' build-storybook",

This uses the cross-env package to set the NODE_OPTIONS environmental variable, but you could set the variable another way.

dopry commented 1 year ago

Duplicate of #16555

tigrr commented 1 year ago

This is fixed in Storybook 7.0.0 beta

shilman commented 1 year ago

Closing as fixed in 7.0