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

[Bug]: Runtime issue with Angular 15 #20031

Closed
bmayen opened this issue Nov 30, 2022 · 2 comments
Closed

[Bug]: Runtime issue with Angular 15 #20031

bmayen opened this issue Nov 30, 2022 · 2 comments

Comments

@bmayen
Copy link

bmayen commented Nov 30, 2022

Describe the bug

Builds previously worked fine with Angular 14, but after upgrading to v15 I get the following runtime error after building and running the app:

Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.
Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)

This does not happen when I serve Storybook during local dev, only when running build-storybook then running with http-server.

To Reproduce

`npx sb@next repro` does not offer Angular 15 as an option.

I did create an Angular 15 app from scratch and installed Storybook, so I can confirm that this bug exists in the most basic configuration.

System

Environment Info:

  System:
    OS: macOS 12.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    npm: 9.1.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Chrome: 108.0.5359.71
    Firefox: 101.0
    Safari: 16.0
  npmPackages:
    @storybook/addon-actions: ^6.5.13 => 6.5.13
    @storybook/addon-essentials: ^6.5.13 => 6.5.13
    @storybook/addon-interactions: ^6.5.13 => 6.5.13
    @storybook/addon-links: ^6.5.13 => 6.5.13
    @storybook/angular: ^6.5.13 => 6.5.13
    @storybook/builder-webpack5: ^6.5.13 => 6.5.13
    @storybook/manager-webpack5: ^6.5.13 => 6.5.13
    @storybook/testing-library: ^0.0.13 => 0.0.13

Additional context

This appears to be a race condition. If I navigate between the different default stories of a brand new Storybook installation, every other story loads fine.

In Angular 15, polyfills can be included directly in angular.json like "polyfills": ["zone.js"] instead of using separate polyfills.ts. Perhaps there's an issue around this with the @storybook/angular:build-storybook executer?

@bmayen bmayen changed the title [Bug]: Build issue with Angular 15 [Bug]: Runtime issue with Angular 15 Nov 30, 2022
@valentinpalkovic valentinpalkovic self-assigned this Dec 1, 2022
@valentinpalkovic
Copy link
Contributor

Hi @bmayen

Please upgrade your Storybook dependencies from ^6.5.13 to at least ^6.5.14. Let me know if the error still occurs. Also, you could try to use the latest alpha 7.0.0-alpha.58.

@bmayen
Copy link
Author

bmayen commented Dec 6, 2022

Looks like 6.5.14 fixed it, although I'm not sure what in that release addresses this issue directly. I see #20043 but it doesn't look related.

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

2 participants