error solved

Fix – plugin preset files are not allowed to export objects only functions


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!


Share on social media

//