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
Storybook config accepts as staticDirs property objects of {from: 'path', to: 'path2'} but prior to storybook 8.4 it could also resolve directly to files. e.g.
{
from: "../some/directory/of/images/react-icon.svg",
to: "/assets/images/react-icon.svg",
},
Storybook 8.4 however cannot resolve the image and attempts to render a broken html page when opening the URL directly. We specify images directly in the staticDirs config property to limit the number of assets that are uploaded to a cloud bucket at release time as uploading the entire folder was causing rate limits to kick in with our cloud provider.
I haven't had the chance to dig too much into it but my instinct suggests this was caused by migrating from express to polka in #29230 and the use of sirv which appears to only handle directories.
The text was updated successfully, but these errors were encountered:
Additionally I would like to add that it appears we can't configure mappings originating from /node_modules anymore.
Just wanted to drop that here, will create a dedicated issue report in a few weeks if this is not really related.
I'm pretty sure OP is correct that this is related to sirv.
FWIW passing in file paths (as opposed to directory paths) has never been officially supported nor documented, I guess it just worked by chance because of the underlying implementation.
These are the docs I could find on staticDirs, and all of them exclusively mention directories:
Describe the bug
Storybook config accepts as staticDirs property objects of
{from: 'path', to: 'path2'}
but prior to storybook 8.4 it could also resolve directly to files. e.g.Storybook 8.4 however cannot resolve the image and attempts to render a broken html page when opening the URL directly. We specify images directly in the staticDirs config property to limit the number of assets that are uploaded to a cloud bucket at release time as uploading the entire folder was causing rate limits to kick in with our cloud provider.
Reproduction link
https://github.com/jackw/storybook-84-asset-bug
Reproduction steps
chromaui/intro-storybook-react-template
template)yarn install
yarn storybook
storybook-8.4
yarn install
yarn storybook
System
Additional context
I haven't had the chance to dig too much into it but my instinct suggests this was caused by migrating from
express
topolka
in #29230 and the use of sirv which appears to only handle directories.The text was updated successfully, but these errors were encountered: