Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opening static storybook does not load stories #17884

Closed
yoanne2x opened this issue Apr 5, 2022 · 3 comments
Closed

opening static storybook does not load stories #17884

yoanne2x opened this issue Apr 5, 2022 · 3 comments

Comments

@yoanne2x
Copy link

yoanne2x commented Apr 5, 2022

Describe the bug

  • build storybook statically,
  • open index.html and an error is displayed in left-hand column: "Oh no! Something went wrong loading this Storybook. View error View docs"

To Reproduce

the error above will be displayed, the console log will have:

Access to fetch at 'file:///Users/yoann/workspace/projects/gw/new-web/gw-web-ui/packages/sb-static/storybook-static/stories.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
stories.json:1 Failed to load resource: net::ERR_FAILED
iframe.html?id=&viewMode=story:333 unable to connect to top frame for connecting dev tools
(anonymous) @ iframe.html?id=
&viewMode=story:333
iframe.html:425 Access to script at 'file:///assets/iframe.0a7c9221.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
/assets/iframe.0a7c9221.js:1 Failed to load resource: net::ERR_FAILED
/assets/iframe.7ee421ea.css:1 Failed to load resource: net::ERR_FILE_NOT_FOUND

System

Environment Info:

System:
OS: macOS 12.3.1
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Binaries:
Node: 14.19.1 - ~/.nvm/versions/node/v14.19.1/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.16 - ~/.nvm/versions/node/v14.19.1/bin/npm
Browsers:
Chrome: 100.0.4896.75
Safari: 15.4

Additional context
Add any other context about the problem here.

@fox-john
Copy link

I have same problem, with vite and storybook for vue3.
image

@IanVS
Copy link
Member

IanVS commented Apr 22, 2022

open generated index.html in storybook-static using chrome

You cannot open the files directly, they need to be served by a webserver. Try using:

npx http-server storybook-static

Please let us know if you still have trouble.

@IanVS IanVS closed this as completed Apr 22, 2022
@Pickra
Copy link
Contributor

Pickra commented Aug 23, 2022

@IanVS
npx http-server storybook-static worked like a charm, THANK YOU!

Any chance of adding this to the docs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants