This content originally appeared on CodeSource.io and was authored by Deven
if you are facing this error “plugin preset files are not allowed to export objects only functions” The problem is mostly because of the older babel version which can be fixed easily.
Run the following command in your terminal:
npm i -D @babel/plugin-proposal-class-properties \
@babel/preset-react \
@babel/preset-env \
@babel/core \
@babel/plugin-transform-runtime \
and update the .babelrc
file like so:
{
"presets": [
"@babel/react" ,
"@babel/env" ,
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
That’s it your problem is now solved!
The post Fix – plugin preset files are not allowed to export objects only functions appeared first on CodeSource.io.
This content originally appeared on CodeSource.io and was authored by Deven

Deven | Sciencx (2021-02-11T07:40:53+00:00) Fix – plugin preset files are not allowed to export objects only functions. Retrieved from https://www.scien.cx/2021/02/11/fix-plugin-preset-files-are-not-allowed-to-export-objects-only-functions/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.