Storybook: Using any theme makes addon-a11y crash

Created on 27 Feb 2019  路  7Comments  路  Source: storybookjs/storybook

  1. Use a theme, e.g.:
setOptions({ theme: themes.dark })
  1. Open accessibility tab

Page crashes with

Uncaught TypeError: Cannot read property 'name' of undefined
a11y bug high priority theming

All 7 comments

@Hypnosphi Setting a theme as a parameter is recommended:

// config.js

import { themes } from '@storybook/theming';
import { configure, addParameters } from '@storybook/react';

addParameters({
  options: {
    theme: themes.light,
  },
});

That should work, but I'll look into why the code you posted results in an error.

@ndelangen I repro'd with parameter style in official-storybook, FYI

I see, will investigate

@ndelangen Still seeing this on rc.9 even after merging #5787 馃槮

Same on rc.10. I think I'll remove my custom theme for now

Yippee!! I just released https://github.com/storybooks/storybook/releases/tag/v5.0.0-rc.11 containing PR #5843 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

Was this page helpful?
0 / 5 - 0 ratings