Storybook: using @storybook/addon-essentials breaks the manual build

Created on 15 Aug 2020  ·  4Comments  ·  Source: nuxt-community/storybook

Version

@nuxtjs/storybook: 1.2.0
nuxt: v2.14.1

Steps to reproduce

  1. npm i -D @storybook/addon-essentials
  2. Follow the guide here:
    https://storybook.nuxtjs.org/manual-setup
  3. npx nuxt-storybook

What is Expected?

Storybook working

What is actually happening?

WARN Unable to find main.js: /Users/alex/fundbox/website_storyblok/Users/alex/fundbox/website_storyblok/storybook/main
info => Loading presets
WARN Unable to find main.js: /Users/alex/fundbox/website_storyblok/Users/alex/fundbox/website_storyblok/storybook/main
info => Loading config/preview file in "/Users/alex/fundbox/website_storyblok/storybook".
info => Loading config/preview file in "/Users/alex/fundbox/website_storyblok/storybook".
WARN We found no files matching any of the following globs:
WARN
WARN ~/components/**/*.stories.@(ts|js)
WARN ~/stories/**/*.stories.js
WARN
WARN Maybe your glob was invalid?
WARN see: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#correct-globs-in-mainjs
WARN Unable to find main.js: /Users/alex/fundbox/website_storyblok/Users/alex/fundbox/website_storyblok/storybook/main
WARN Unable to close preview build!
ERR! WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
ERR!  - configuration.entry should not contain the item '/Users/alex/fundbox/website_storyblok/node_modules/@storybook/addon-actions/dist/register.js' twice.
ERR!    -> A non-empty array of non-empty strings
ERR!     at webpack (/Users/alex/fundbox/website_storyblok/node_modules/webpack/lib/webpack.js:31:9)
ERR!     at /Users/alex/fundbox/website_storyblok/node_modules/@storybook/core/dist/server/dev-server.js:69:48
ERR!  WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
ERR!  - configuration.entry should not contain the item '/Users/alex/fundbox/website_storyblok/node_modules/@storybook/addon-actions/dist/register.js' twice.
ERR!    -> A non-empty array of non-empty strings
ERR!     at webpack (/Users/alex/fundbox/website_storyblok/node_modules/webpack/lib/webpack.js:31:9)
ERR!     at /Users/alex/fundbox/website_storyblok/node_modules/@storybook/core/dist/server/dev-server.js:69:48

bug

Most helpful comment

actions are required for nuxt-link mock component. I see no reason to embed unused addons in the package. Also, this may break current projects.
Maybe we could create a separate issue to discuss bundled addons

All 4 comments

@nuxtjs/storybook internally register @storybook/addon-actions, if you want to use @storybook/addon-essentials you need to disable actions addon

addons: [{
    name: '@storybook/addon-essentials',
    options: {
      actions: false,
    }
  }]

@farnabaz given that actions are bundled into essentials in storybook, maybe it's worth bundling essentials instead of just actions in nuxt/storybook?

actions are required for nuxt-link mock component. I see no reason to embed unused addons in the package. Also, this may break current projects.
Maybe we could create a separate issue to discuss bundled addons

The thing is that the official storybook docs say:

Storybook ships by default with a set of “essential” addons that add to the initial user experience.
Docs
Controls
Actions
Viewport
Backgrounds
Toolbars & globals

That lead on my side to confusion because I was expecting them to be present but they weren't.

In general I agree with @farnabaz but because of the documentation I would suggest to add them.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ponnex picture ponnex  ·  5Comments

drewbaker picture drewbaker  ·  5Comments

seancolsen picture seancolsen  ·  4Comments

Atinux picture Atinux  ·  3Comments

armorkram picture armorkram  ·  3Comments