question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@storybook/addon-a11y raises an error related to Promise polyfill

See original GitHub issue

Describe the bug After updating to @angular~8.0.0 and @storybook/angular~5.1.3 started to get unhandled promise rejections.

To Reproduce Steps to reproduce the behavior:

  1. Update @angular to version 8.0.0 using CLI tool
  2. Update storybook and all related addons to 5.1.3
  3. The addon-a11y should be imported in the addons.js
  4. Run storybook
  5. None of components are displayed on canvas
  6. In the console an unhandled Error is displayed related to Zone.js

Expected behavior The addons should try reuse the version of core-js that is installed.

Screenshots image

Code snippets package.json:

{
  "name": "web-app-prototype",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "start:mock": "ng serve --configuration=mock",
    "build": "ng build",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:ci": "jest --runInBand",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "start:local-prod": "ng build --prod && http-server -p 8000 -c-1 dist/web-app-prototype",
    "storybook": "start-storybook"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~8.0.0",
    "@angular/cdk": "~8.0.0",
    "@angular/common": "~8.0.0",
    "@angular/compiler": "~8.0.0",
    "@angular/core": "~8.0.0",
    "@angular/forms": "~8.0.0",
    "@angular/material": "^8.0.0",
    "@angular/platform-browser": "~8.0.0",
    "@angular/platform-browser-dynamic": "~8.0.0",
    "@angular/pwa": "^0.12.4",
    "@angular/router": "~8.0.0",
    "@angular/service-worker": "~8.0.0",
    "@ngrx/effects": "^7.4.0",
    "@ngrx/entity": "^7.4.0",
    "@ngrx/store": "^7.4.0",
    "@ngrx/store-devtools": "^7.4.0",
    "core-js": "^3.1.3",
    "hammerjs": "^2.0.8",
    "rxjs": "~6.5.2",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.800.0",
    "@angular/cli": "~8.0.2",
    "@angular/compiler-cli": "~8.0.0",
    "@angular/language-service": "~8.0.0",
    "@babel/core": "^7.4.4",
    "@ngrx/schematics": "^7.4.0",
    "@status/codes": "^1.2.0",
    "@storybook/addon-a11y": "^5.1.3",
    "@storybook/addon-actions": "^5.1.3",
    "@storybook/addon-console": "^1.1.0",
    "@storybook/addon-events": "^5.1.3",
    "@storybook/addon-jest": "^5.1.3",
    "@storybook/addon-knobs": "^5.1.3",
    "@storybook/addon-links": "^5.1.3",
    "@storybook/addon-notes": "^5.1.3",
    "@storybook/addon-storysource": "^5.1.3",
    "@storybook/addon-viewport": "^5.1.3",
    "@storybook/angular": "^5.1.3",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.6",
    "@types/jest": "^24.0.13",
    "@types/node": "~12.0.7",
    "babel-loader": "^8.0.5",
    "codelyzer": "^5.1.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "jest": "^24.8.0",
    "jest-preset-angular": "^7.1.1",
    "jws": "^3.2.2",
    "protractor": "~5.4.2",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.4.5"
  },
  "jest": {
    "preset": "jest-preset-angular",
    "setupTestFrameworkScriptFile": "<rootDir>/src/setupJest.ts"
  }
}

System:

  • OS: MacOS 10.14.5
  • Device: MacBook Pro 13 2017
  • Browser: chrome
  • Framework: angular
  • Addons: @storybook/addon-a11y - ^5.1.3
  • Version: 5.1.3

Additional context When I remove all the imports of the addon-a11y the issue disappears

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:19 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
acaillycommented, Oct 17, 2019

I cloned the example repo (https://github.com/brenzy/storybook-zone-issue) and updated storybook

npx npm-check-updates '/storybook/' -u
npm install

It updated to 5.2.4 and it seems to work. Tested with npm 6.9.0 and node 10.16.0.

However, I still have the issue described in https://github.com/storybookjs/storybook/issues/7318 on my project 😕

1reaction
brenzycommented, Jul 14, 2019

I added a repo to reproduce this issue at: https://github.com/brenzy/storybook-zone-issue While attempting to recreate the issue, I noticed that if I used npm install the issue would occur, but if I used yarn install the issue would not occur.

Read more comments on GitHub >

github_iconTop Results From Across the Web

promise-polyfill - npm
Start using promise-polyfill in your project by running `npm i ... There are 973 other projects in the npm registry using promise-polyfill.
Read more >
How to Polyfill Promise in Visual Studio 2017 Office Add-in ...
I have require('core-js'); declared at the top of FunctionFile.ts, but the error persists. I followed the guidance provided in this question : ...
Read more >
JavaScript: Polyfills for Promise | by D DEV
If all the promises are rejected, it would reject the Promise, or successfully send an error. The definition of Promise.any is rather simple....
Read more >
Promise(executor) - Mithril.js
Documentation on Mithril.js' Promise polyfill. ... If this function throws, nextPromise is rejected with the error as its reason.
Read more >
Promise Error Handling - JavaScript Tutorial
In this tutorial, you will learn about promise error handling that shows you how ... When you raise an exception outside the promise,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found