You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since upgrading to storybook 8.4.5 from 8.2.9, our custom theming seems not to take effect in the built bundle.
Upon investigating the network requests made by the hosted Storybook, it seems some calls to manager-bundle.js do not take the publicDir configuration option into account, while most others do.
The first few calls do not take config.publicDir into account. These originate from script tags embedded in the index.html.
While calls originating from js files do take it into account.
Our built storybook can be found here, the above screenshot were taken from this page's devtools.
We use Storybook's react+vite+ts flavor for our internal uikit's documentation, and theme it using "@storybook/theming/create" and .storybook/manager.ts.
Once built, we host our storybook under the /design-system route on our website.
As such, we've set the following configuration options in .storybook/main.ts
import{mergeConfig}from"vite";exportdefault{// ... other configurationviteFinal: (config)=>{constoverrides={base: "/design-system"publicDir: "/design-system"}returnmergeConfig(config,overrides);}}
Explored potential fixes
These are the things we tried to fix this issue, to no avail:
Setting config.build.outDir - Did change the output directory of the bundle, did not change links
Running storybook build with the -o flag - Same as above
The text was updated successfully, but these errors were encountered:
We're experiencing this too running [email protected] - we can log out the resolved config before and after calling mergeConfig and see the options are there, but they are not being honoured in the final built output.
We're also seeing a 404 for the <link> tag that references ./sb-preview/runtime.js — the suggested fix for this problem takes a similar approach, using viteFinal to modify the config.
But that's not working for us either. The issues feel kind of related, like Storybook is not merging configs correctly?
As it stands, that directory just doesn't exist in the storybook-static directory after building.
Describe the bug
Since upgrading to storybook
8.4.5
from8.2.9
, our custom theming seems not to take effect in the built bundle.Upon investigating the network requests made by the hosted Storybook, it seems some calls to
manager-bundle.js
do not take thepublicDir
configuration option into account, while most others do.The first few calls do not take
config.publicDir
into account. These originate from script tags embedded in theindex.html
.While calls originating from js files do take it into account.
Our built storybook can be found here, the above screenshot were taken from this page's devtools.
Reproduction link
https://stackblitz.com/edit/github-tvfaqaeh?file=.storybook%2Fmain.ts&view=editor
Reproduction steps
config.base
andconfig.publicDir
inviteFinal
System
Additional context
We use Storybook's
react+vite+ts
flavor for our internal uikit's documentation, and theme it using"@storybook/theming/create"
and.storybook/manager.ts
.Once built, we host our storybook under the
/design-system
route on our website.As such, we've set the following configuration options in
.storybook/main.ts
Explored potential fixes
These are the things we tried to fix this issue, to no avail:
config.build.outDir
- Did change the output directory of the bundle, did not change linksstorybook build
with the-o
flag - Same as aboveThe text was updated successfully, but these errors were encountered: