-
Notifications
You must be signed in to change notification settings - Fork 247
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 #77
Comments
regeneratorRuntime is not part of bable anymore. Add this to you package.json:
and this to your (main) index.js as first imports:
|
I have this problem too. It is causing our unit tests to fail, but works in production. I tried the above package.json and index.js additional package fixes and it did not make a difference. I get this error when trying to import DropzoneArea:
ReferenceError: regeneratorRuntime is not defined Edit: I was able to fix this by only installing "regenerator-runtime" as a dependency (core-js-pure was not needed for me), and then importing that dependency into the file that had my DropzoneArea component. It did not work when I imported it into my App.js or Index.js file. |
I've encountered the same problem. My solution was very similar to @Tassfighter . Here is my solution my .babelrc file For normal setups other than Next JS, below is the configuration my .babelrc file If you are using "usage" option you don't need to import core-js and regenerator-runtime, but Next JS creates a problem if you are using "usage" option. You need to use "entry" option and import the files in Next JS. |
How is this fixable for a pure CRA app? I am stuck with 2.4.1 now. |
Just install core-js and regenerator-runtime and add the imports to the top of your app.js |
Perhaps it's my limited knowledge, but I don't like importing packages when I'm not sure what they do. I've decided to switch to react-dropzone instead. |
You already did use those packages in the past. Those packages have been removed from babel, thats the reason for the issue. These packages are just ECMA polyfills see
I don't mind at all. But sooner or later, you will face the same problem again with other packages. |
The problem is with this package people. It should come bundled with all of the dependencies. This is not the only problem with this package. I am getting a deprecation warning about componentWillReceiveProps. |
@onukselcuk Thanks for pointing at the right direction. I'm using Next JS too. But importing them in _app.js doesn't work for me. Even if they are the first 2 imports. I instead import them just before importing material-ui-dropzone to solve the problem. |
@krizpoon actually I moved imports to the top of _document.js file. I should have edited my comment. Importing them in the component file didn't work for me. |
@Tassfighter Why can't Right now to get mui-dropzone to work I have to google the error, find this issue, and manually install and import Edit: saw you're not the author, updated project ownership |
Let me try to explain (but don't quote me, I am not really sure...) |
@Tassfighter this library should list all their dependencies. And if another library uses a different version of regeneratorRuntime, it will be handled as it is handled with all other libraries. It's a common issue. The behavior as it is now is a bug. |
As of version Closing this issue. |
After upgrading from 2.4.1 to 2.4.2, I'm now seeing the following error:
ReferenceError: regeneratorRuntime is not defined
The text was updated successfully, but these errors were encountered: