storybook: Core: Theme updates don't invalidate manager caching

6.1 includes manager caching, where the manager UI is only built on changes to the manager config. However, changing the theme doesn’t invalidate the cache.

Reproduction

Set up a fresh CRA install and add a theme to .storybook/manager.js:

import { addons } from "@storybook/addons";
import { themes } from "@storybook/theming";

addons.setConfig({
  theme: themes.dark,
});

Run yarn storybook and cache the manager.

Then update the theme:

addons.setConfig({
  theme: themes.light,
});

Observe that it is still using the original cached manager, rather than re-caching to reflect the change.

Workaround

As a workaround you can run yarn storybook --no-manager-cache to manually invalidate.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 30
  • Comments: 20 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I am still having the same issue, adding --no-manager-cache not updating my theme updates, I want to update the Logo, is there any other way to replace it?

Delete the .cache folder from node_modules, run the storybook again, it should solve the problem.

I am using version 6.1.11

After adding --no-manager-cache with start command, it continues to say info => Using cached manager and the theme doesn’t update.

Does anyone have a viable solution, I have tried everything, clearing storage, hard-refreshing, but the problem seems to be in storybook cache managemnt.

‘storybook-dark-mode/register’,

… you can’t use dark-mode and customized theme together, i hope that help you.

I am still having the same issue, adding --no-manager-cache not updating my theme updates, I want to update the Logo, is there any other way to replace it?