[Help Needed] ZoneAwarePromise `(window|global).Promise` has been overwritten
See original GitHub issueHi, I got Storybook successful setup with Angular 7 on a MacOS 10.14.5, but couldn’t get Storyshots working.
Below is the error I got, as you can see, my other Jest tests were running fine without any problems, but Storyshots won’t generate snapshots from the stories, looks like global[“Promise”] was overwritten by es.promise.js
.
I tried fiddling around with the files in node_modules/@storybook/addon-storyshots/dist/frameworks/angular/loader.js
, and make sure zone.js
was imported after es.promise.js
, but still no avail.
Any clues? Thanks!
...
● Storyshots › Another Button › button with link to another story
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.)
at Function.Object.<anonymous>.Zone.assertZonePatched (node_modules/zone.js/dist/zone.js:58:23)
at new NgZone (../packages/core/src/zone/ng_zone.ts:123:10)
at TestBedViewEngine._initIfNeeded (../../packages/core/testing/src/test_bed.ts:408:20)
at TestBedViewEngine.createComponent (../../packages/core/testing/src/test_bed.ts:594:10)
at Function.TestBedViewEngine.createComponent (../../packages/core/testing/src/test_bed.ts:247:36)
at _testing.TestBed.compileComponents.then (node_modules/@storybook/addon-storyshots/dist/frameworks/angular/renderTree.js:56:35)
at node_modules/@storybook/addon-storyshots/node_modules/core-js/modules/es.promise.js:105:22
at flush (node_modules/@storybook/addon-storyshots/node_modules/core-js/internals/microtask.js:26:9)
Test Suites: 1 failed, 18 passed, 19 total
Tests: 8 failed, 126 passed, 134 total
Snapshots: 0 total
Time: 28.119s, estimated 30s
Ran all test suites.
Issue Analytics
- State:
- Created 4 years ago
- Comments:29 (3 by maintainers)
Top Results From Across the Web
Unhandled promise rejection: Zone.js has detected that ...
Unhandled promise rejection: Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten · There's no necessity to ...
Read more >Zone.js has detected that ZoneAwarePromise `(window|global ...
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 ( ......
Read more >Zone.js has detected that ZoneAwarePromise `(window|global ...
Error: "Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten. Most likely cause is that a Promise ...
Read more >Angular 2 Universal Starter - Heroku Elements
Promise ` has been overwritten. It occurs because Zone.js Promise implementation is not detected as Promise by some polyfills (e.g. es6-promise before 4.x)....
Read more >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 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just gonna bump it as this is a serious issue for us.
Thank you @xemlock, I had the exact same issue on Firefox and Safari (while it worked on Chrome).
I had to put the code in
.storybook/webpack.config.js
though: