Async/Await
See original GitHub issueI’m using a vanilla setup of StoryBook with no tweaks to babel. If I use async/await
I get an error of:
regeneratorRuntime is not defined
Typically the babel-polyfill
is required to have async/await work on the client. What are the steps to get this working within StoryBook?
I tried importing babel-polyfill
within the .storybook/config.js
but to no avail.
Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (9 by maintainers)
Top Results From Across the Web
Async/await - The Modern JavaScript Tutorial
The async keyword before a function has two effects: ... The await keyword before a promise makes JavaScript wait until that promise settles,...
Read more >asyncawait - npm
Start using asyncawait in your project by running `npm i asyncawait`. There are 117 other projects in the npm registry using asyncawait.
Read more >yortus/asyncawait: Callback heaven for Node.js with async/await
This library has enabled async/await coding style in Node.js since 2014. But JavaScript now has native async/await. JS async/await was standardized as part ......
Read more >Mastering Async/Await
No more deeply nested callbacks or convoluted promise chains. With async/await, you can make that dream a reality. Mastering Async/Await provides a concise...
Read more >AsyncAwait - deferred subroutine syntax for futures - MetaCPAN
This module provides syntax for deferring and resuming subroutines while waiting for Futures to complete. This syntax aims to make code that performs ......
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 Free
Top 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
@kgoggin I solved a very similar issue just now (regeneratorRuntime was expected in the global scope by
redux-form-saga
so it borked storybook) by simply manually adding regeneratorRuntime to the global scope in config.js (window.regeneratorRuntime = require('babel-runtime/regenerator');
). I don’t like this solution and plan to investigate further later, but if you’re looking for a quick workaround perhaps that’ll help.