Storybook: next.js Access storybook

Created on 20 Nov 2020  路  6Comments  路  Source: storybookjs/storybook

install

   npx sb init

run

npm run storybook

Here is the error report.Ask for help, thank you!

[./node_modules/webpack-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined] 7.68 KiB {vendors~main}
    + 3233 hidden modules

ERROR in ./.storybook/preview.js-generated-config-entry.js
Module not found: Error: Can't resolve 'core-js/modules/es.array.filter' in '/Users/tang/Desktop/ZATECH/myTeam/platform-sompo-web/my-page-sj/.storybook'
 @ ./.storybook/preview.js-generated-config-entry.js 5:0-42
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/storybook-init-framework-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js-generated-other-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js-generated-other-entry.js ./node_modules/@storybook/addon-links/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addArgs.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/preset/addParameter.js-generated-other-entry.js ./.storybook/preview.js-generated-config-entry.js ./.storybook/generated-stories-entry.js ./node_modules/webpack-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined

ERROR in ./.storybook/preview.js-generated-config-entry.js
Module not found: Error: Can't resolve 'core-js/modules/es.array.for-each' in '/Users/tang/Desktop/ZATECH/myTeam/platform-sompo-web/my-page-sj/.storybook'
 @ ./.storybook/preview.js-generated-config-entry.js 7:0-44
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/storybook-init-framework-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js-generated-other-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js-generated-other-entry.js ./node_modules/@storybook/addon-links/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addArgs.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/preset/addParameter.js-generated-other-entry.js ./.storybook/preview.js-generated-config-entry.js ./.storybook/generated-stories-entry.js ./node_modules/webpack-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined
P1 compatibility with other tools core dependencies duplicate question / support

Most helpful comment

@eric-burel the core-js install helped. npm install core-js@^3.0.1 --save-dev. Thanks.

All 6 comments

cc @eric-burel

@WYJTang did you check this already? https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#core-js-dependency-errors

Also do you have a reproduction or is it private code maybe?

Which version of Next are you using?

@eric-burel the core-js install helped. npm install core-js@^3.0.1 --save-dev. Thanks.

Let me close this issue for now but feel free to tag me if this core js update is not sufficient.

@eric-burel Hello! At present, the project is private and cannot be made public. I am using version 9.52.

@WYJTang can you run yarn why core-js? Those issues are most probably a mismatch between Babel core-js dependency and Storybook dependency, see this Stack Overflow question for example.
Like one tool is using version 2 and another version 3, this bug happened a lot at a certain point in time when Babel was transitioning to core-js v3.

Was this page helpful?
0 / 5 - 0 ratings