storybook-addon-console icon indicating copy to clipboard operation
storybook-addon-console copied to clipboard

[Bug] Errors when running on storybook 6

Open SimeonC opened this issue 3 years ago • 4 comments

Describe the bug

If I add this addon to my storybook v6, it throws an error and storybook doesn't start-up.

Steps to reproduce the behavior

  1. Setup Storybook v6
  2. Set the addons to addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-console'],
  3. Run start-storybook
  4. Error

Expected behavior

Shouldn't error.

Screenshots and/or logs

ERR! Error: Accessing non-existent addons channel, see https://storybook.js.org/basics/faq/#why-is-there-no-addons-channel
ERR!     at AddonStore.getChannel (/Users/simeon.cheeseman/Development/settings-frontend/node_modules/@storybook/addons/dist/index.js:53:13)
ERR!     at Object.actionHandler [as log] (/Users/simeon.cheeseman/Development/settings-frontend/node_modules/@storybook/addon-actions/dist/preview/action.js:23:34)
ERR!     at console.logger.log (/Users/simeon.cheeseman/Development/settings-frontend/node_modules/@storybook/addon-console/dist/index.js:113:37)
ERR!     at outputStartupInformation (/Users/simeon.cheeseman/Development/settings-frontend/node_modules/@storybook/core/dist/server/build-dev.js:253:11)
ERR!     at buildDevStandalone (/Users/simeon.cheeseman/Development/settings-frontend/node_modules/@storybook/core/dist/server/build-dev.js:333:5)
ERR!     at processTicksAndRejections (node:internal/process/task_queues:94:5)

Environment

  • OS: OSX 11.2.2
  • Node.js version: 15.9.0
  • NPM version: 7.5.3

SimeonC avatar Mar 16 '21 03:03 SimeonC

I have the same error, but in a different context. I can't install storybook-addon-console because of "Accessing non-existent addons channel".

I'm running storybook with ember.

  • ember-cli: 3.25.2
  • node: 14.16.0
  • os: darwin x64

Anne-Gaelle-S avatar Mar 17 '21 15:03 Anne-Gaelle-S

Just add below line to the preview.js import '@storybook/addon-console'

Its work for me😂

BryanAdamss avatar Mar 29 '21 06:03 BryanAdamss

Don't put @storybook/addon-actions into addons array, just create preview.js and import it. It's work for me (storybook v6.2.9).

// .storybook/main.js
  addons: [
    '@storybook/addon-links',
    '@storybook/addon-essentials'
  ],
// .storybook/preview.js
import '@storybook/addon-console';

zhangyu1818 avatar May 29 '21 12:05 zhangyu1818

Don't put @storybook/addon-actions into addons array, just create preview.js and import it. It's work for me (storybook v6.2.9).

// .storybook/main.js
  addons: [
    '@storybook/addon-links',
    '@storybook/addon-essentials'
  ],
// .storybook/preview.js
import '@storybook/addon-console';

this won't work for newer storybook will it? uses module.export so

import '@storybook/addon-console'; is not valid.

Todilo avatar Jan 06 '22 13:01 Todilo