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…

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

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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Fix – plugin preset files are not allowed to export objects only functions." Deven | Sciencx - Thursday February 11, 2021, https://www.scien.cx/2021/02/11/fix-plugin-preset-files-are-not-allowed-to-export-objects-only-functions/
HARVARD
Deven | Sciencx Thursday February 11, 2021 » Fix – plugin preset files are not allowed to export objects only functions., viewed ,<https://www.scien.cx/2021/02/11/fix-plugin-preset-files-are-not-allowed-to-export-objects-only-functions/>
VANCOUVER
Deven | Sciencx - » Fix – plugin preset files are not allowed to export objects only functions. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/02/11/fix-plugin-preset-files-are-not-allowed-to-export-objects-only-functions/
CHICAGO
" » Fix – plugin preset files are not allowed to export objects only functions." Deven | Sciencx - Accessed . https://www.scien.cx/2021/02/11/fix-plugin-preset-files-are-not-allowed-to-export-objects-only-functions/
IEEE
" » Fix – plugin preset files are not allowed to export objects only functions." Deven | Sciencx [Online]. Available: https://www.scien.cx/2021/02/11/fix-plugin-preset-files-are-not-allowed-to-export-objects-only-functions/. [Accessed: ]
rf:citation
» Fix – plugin preset files are not allowed to export objects only functions | Deven | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.