-
Notifications
You must be signed in to change notification settings - Fork 111
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
ReferenceError: regeneratorRuntime is not defined #71
Comments
So from what I understand, for webpack to let your code use async, your code needs to explicity import a polyfill. My current code is using babel/polyfill, but I believe that's been deprecated so maybe try https://github.com/facebook/create-react-app/tree/master/packages/react-app-polyfill instead? Knowing that workers and your main thread are completely seperate, it's reasonable to assume you'd need to do this in your worker code too. So I added tl;dr Try adding |
Yup, make sure to import a polyfill your code depends on. |
What about typescript? There's still a similar error there |
import regenerator in your worker file: // foo.worker.ts
import 'regenerator-runtime';
// your code |
I'm trying to use this library with Babel and TypeScript, but I'm getting a weird error.
Then, when the function is called, I get this error:
This is what the config for the loader looks like:
The text was updated successfully, but these errors were encountered: