Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

showRoots false throws Module build failed #13406

Closed
brothatru opened this issue Dec 9, 2020 · 3 comments
Closed

showRoots false throws Module build failed #13406

brothatru opened this issue Dec 9, 2020 · 3 comments

Comments

@brothatru
Copy link

Describe the bug
Setting showRoots to false in .storybook/manager.js crashes storybook's browser application.

To Reproduce

  1. Install storybook 6.1.10
  2. Copy and paste code from docs for disabling root hierarchy
  3. Restart storybook (npm run storybook)
  4. Browser application renders blank with console errors.
  5. Also tried npm i -D @storybook/addons (same result)

Expected behavior
Root headings should disappear from application's sidebar

Screenshots
Screen Shot 2020-12-08 at 7 04 39 PM

Code snippets

// ./storybook/manager.js

import { addons } from `@storybook/addons`;
addons.setConfig({ showRoots: false });
// ./storybook/main.js

const { TsconfigPathsPlugin } = require('tsconfig-paths-webpack-plugin');

module.exports = {
  stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
  addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
  webpackFinal: async (config) => {
    config.resolve.plugins.push(new TsconfigPathsPlugin({}));
    return config;
  },
};

System
Environment Info:

System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries:
Node: 12.18.3 - /usr/local/bin/node
npm: 6.14.9 - /usr/local/bin/npm
Browsers:
Chrome: 87.0.4280.88
Safari: 14.0
npmPackages:
@storybook/addon-actions: ^6.1.10 => 6.1.10
@storybook/addon-essentials: ^6.1.10 => 6.1.10
@storybook/addon-links: ^6.1.10 => 6.1.10
@storybook/addons: ^6.1.10 => 6.1.10
@storybook/react: ^6.1.10 => 6.1.10

Additional context
Just installed today, went through documentation and trying things out...

@shilman
Copy link
Member

shilman commented Dec 9, 2020

The code is slightly wrong. It should be:

import { addons } from '@storybook/addons';

I'm updating the docs now

@brothatru
Copy link
Author

Just to provide closure, was able to get this working after updating quotes and invalidating the cached manager.js.

start-storybook -p 6006 --no-manager-cache

More details about cached manager.js here ~ issue 13200.

@shilman
Copy link
Member

shilman commented Dec 10, 2020

cc @ghengeveld on the manager caching

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants