[Bug] regeneratorRuntime is not defined with useAsyncTask
See original GitHub issueI want to use useAsyncTask like so:
const myAsyncTask = useAsyncTask(() => {
return functionThatReturnsPromiseWithMyData('this is an argument')
})
but when I try to run this, I get Uncaught (in promise) ReferenceError: regeneratorRuntime is not defined
I am using vue 3.1.4, vite 2.4.1, and vue-concurrency 2.1.2
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to fix regeneratorRuntime is not defined?
I have ran into a problem, the error is regeneratorRuntime is not defined while working with React and Parcel bundler.
Read more >Babel 6 regeneratorRuntime is not defined
This error is caused when async/await functions are used without the proper Babel plugins. As of March ...
Read more >Regeneratorruntime Is Not Defined In React 17, Webpack ...
I cited an example based on react-hooks-async which has a error: undefined }; return task; }; export const useAsyncTask (func) The one-way data...
Read more >Parcel, how to fix the `regeneratorRuntime is not defined` ...
Parcel, how to fix the `regeneratorRuntime is not defined` error ... avoid this error you need to also load the regenerator-runtime runtime.
Read more >Uncaught ReferenceError: regeneratorRuntime is not defined
Uncaught ReferenceError : regeneratorRuntime is not defined – Two Solutions. Trying to use async/await in my React app gave me this error ...
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

Caused by https://github.com/developit/microbundle/issues/708. I tried to update microbundle but ran into different errors afterwards. I’ll give it another try when I have more time.
With Vue 3 & Vite I’ve been using the temporary fix of :
npm install regenerator-runtimeimport 'regenerator-runtime/runtime'at the top ofmain.tsIf you’re using webpack/babel (ie Vue 2), you can also import it directly without the extra package:
import '@babel/runtime/regenerator';