Storybook: If file merge, it's not excute (addons, preset -> main)

Created on 21 Jan 2020  路  4Comments  路  Source: storybookjs/storybook

addon.js
import "@storybook/addon-actions/register";
import "@storybook/addon-links/register";
import "@storybook/addon-knobs/register";
import "@storybook/addon-console";
import "@storybook/addon-a11y/register";
import "@storybook/addon-docs/register";
import "storybook-addon-material-ui/register";

presets.js
module.exports = ["@storybook/addon-docs/preset"];

preview.js
import { configure } from "@storybook/react";
import { addDecorator } from "@storybook/react";
import { muiTheme } from "storybook-addon-material-ui";
import { basicTheme, blueTheme } from "styles";
import { theme as localTheme } from "theme";
import React from "react";

addDecorator(
muiTheme([
{ ...basicTheme, ...localTheme },
{ ...blueTheme, ...localTheme }
])
);

configure(require.context("../src/stories", true, /.stories.js$/), module);

Executing using the above three files are done without any problems.
However, if the addons and presets file are removed and used as main, an error occurs.

main.js
module.exports = {
stories: ["../src/stories/*/.stories.(js|mdx)"],
addons: [
"@storybook/addon-actions/register",
"@storybook/addon-links/register",
"@storybook/addon-knobs/register",
"@storybook/addon-a11y/register",
"@storybook/addon-docs/register",
"storybook-addon-material-ui/register",
"@storybook/addon-console"
]
};

preview.js
not change

Error msg
ERR! Error: Accessing non-existent addons channel, see https://storybook.js.org/basics/faq/#why-is-there-no-addons-channel
ERR! at AddonStore.getChannel
ERR! at Object.actionHandler [as log]
ERR! at Console.logger.log
ERR! at outputStartupInformation
ERR! at buildDevStandalone
ERR! at process._tickCallback (internal/process/next_tick.js:68:7)

addons question / support

All 4 comments

Try removing these lines. Does it still error?

"storybook-addon-material-ui/register",
"@storybook/addon-console"

Also, you probably want:

"@storybook/addon-docs"

NOT

"@storybook/addon-docs/register"

Try removing these lines. Does it still error?

"storybook-addon-material-ui/register",
"@storybook/addon-console"

The above 2 addons applied automatically?

No, perhaps one of them has an incompatibility with 5.3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aericson picture aericson  路  97Comments

bpeab picture bpeab  路  70Comments

43081j picture 43081j  路  61Comments

p3k picture p3k  路  61Comments

ilyaulyanov picture ilyaulyanov  路  100Comments