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
- Apply theme as recommended for v6, using --no-manager-cache workaround as described in https://github.com/storybookjs/storybook/issues/13200 — committed to UnlyEd/next-right-now by Vadorequest 3 years ago
Delete the
.cachefolder fromnode_modules, run the storybook again, it should solve the problem.I am using version 6.1.11
After adding
--no-manager-cachewith start command, it continues to sayinfo => Using cached managerand 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.
… 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?