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

storyStoreV7: true causes build static site to crash #16967

Closed
rexkenley opened this issue Dec 9, 2021 · 8 comments
Closed

storyStoreV7: true causes build static site to crash #16967

rexkenley opened this issue Dec 9, 2021 · 8 comments

Comments

@rexkenley
Copy link

Describe the bug
When I set storyStoreV7: true the resulting built static site crashes with this error:
Failed to fetch TypeError: Failed to fetch at _callee2$ (file:///C:/vs/rkt/StorybookV7/storybook-static/155.98adc106.iframe.bundle.js:2:305394) at tryCatch (file:///C:/vs/rkt/StorybookV7/storybook-static/155.98adc106.iframe.bundle.js:2:1278059) at Generator.invoke [as _invoke] (file:///C:/vs/rkt/StorybookV7/storybook-static/155.98adc106.iframe.bundle.js:2:1277682) at Generator.next (file:///C:/vs/rkt/StorybookV7/storybook-static/155.98adc106.iframe.bundle.js:2:1278834) at PreviewWeb_asyncGeneratorStep (file:///C:/vs/rkt/StorybookV7/storybook-static/155.98adc106.iframe.bundle.js:2:298074) at _next (file:///C:/vs/rkt/StorybookV7/storybook-static/155.98adc106.iframe.bundle.js:2:298386) at file:///C:/vs/rkt/StorybookV7/storybook-static/155.98adc106.iframe.bundle.js:2:298558 at new Promise (<anonymous>) at PreviewWeb.<anonymous> (file:///C:/vs/rkt/StorybookV7/storybook-static/155.98adc106.iframe.bundle.js:2:298298) at PreviewWeb.getStoryIndexFromServer (file:///C:/vs/rkt/StorybookV7/storybook-static/155.98adc106.iframe.bundle.js:2:305799)

To Reproduce
https://github.com/rexkenley/StorybookV7
npm run build:storybook

System
System:
OS: Windows 10 10.0.19044
CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
Binaries:
Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 96.0.4664.93
Edge: Spartan (44.19041.1266.0), Chromium (96.0.1054.43)
npmPackages:
@storybook/addon-actions: ^6.4.9 => 6.4.9
@storybook/addon-essentials: ^6.4.9 => 6.4.9
@storybook/addon-interactions: ^6.4.9 => 6.4.9
@storybook/addon-jest: ^6.4.9 => 6.4.9
@storybook/addon-links: ^6.4.9 => 6.4.9
@storybook/builder-webpack5: ^6.4.9 => 6.4.9
@storybook/jest: ^0.0.5 => 0.0.5
@storybook/manager-webpack5: ^6.4.9 => 6.4.9
@storybook/react: ^6.4.9 => 6.4.9
@storybook/testing-library: ^0.0.7 => 0.0.7
@storybook/testing-react: ^1.2.2 => 1.2.2

Additional context
npm run build still seems to be ok. I also noticed that the static build interactions tab is not working.
image
image

@stale
Copy link

stale bot commented Jan 9, 2022

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Jan 9, 2022
@shilman
Copy link
Member

shilman commented Jan 22, 2022

@rexkenley are you still having this problem? i just checked out your reproduction linked above and everything is looking good in github codespaces

@stale stale bot removed the inactive label Jan 22, 2022
@impurity-dev
Copy link

Can confirm that storyStoreV7 causes errors with build-storybook & angular

@rexkenley
Copy link
Author

@shilman, I updated storybook to 6.4.18

npm run build:storybook is working now. But the resulting static site is still broken.
image

The missing interaction issue is still there.

@ahuth
Copy link
Contributor

ahuth commented Apr 21, 2022

I'm seeing this as well when directly opening the static iframe.html file. To add some more info, there's an error in the console with

Access to fetch at 'file:///path/to/static/storybook/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.

Seems like a CORS issue when opening the static storybook files directly and trying to fetch the stories.json.

@ahuth
Copy link
Contributor

ahuth commented May 20, 2022

One way around this is to access the static build through a file server, instead of directly opening it at a file:// url.

e.g.

npx http-server ./storybook-static

@kellyjjrusk
Copy link

We are experiencing the same issue on 6.5.14. We need storyStoreV7 enabled for top level awaits with Webpack. Any updates on this issue/is this resolved in a 6.5.15?

@IanVS
Copy link
Member

IanVS commented Mar 23, 2023

@kellyjjrusk, the answer from @ahuth is correct, you need to open the built storybook assets using a webserver.

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

6 participants