Error: Plugin/Preset files are not allowed to export objects, only functions


#1

For https://github.com/AnomalyInnovations/serverless-stack-demo-api
after upgrading “babel-loader” from “^7.1.5”, to “^8.0.2”, when run ‘serverless deploy -v’ got error:

ERROR in ./create.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Plugin/Preset files are not allowed to export objects, only functions. In ./node_modules/babel-preset-stage-3/lib/index.js


#2

Hmm it might be that there is something new with Babel 8. We internally use serverless-webpack and I don’t think they’ve added support for it yet.