Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.
See original GitHub issueI’m trying to use babel-loader to pack some imported functions to export it to firebase, but the same error is happening every time.
Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.
I just don’t know what to try anymore.
webpack.config.js
module.exports = {
entry: './src/index.js',
output: { path: __dirname, filename: 'index.js' },
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
}
}
Full error
ERROR in ../src/components/services/index.js
Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.
at createDescriptor (C:\Users\Gabriel\Projetos\danfy\functions\node_modules\@babel\core\lib\config\config-descriptor
s.js:158:11)
at C:\Users\Gabriel\Projetos\danfy\functions\node_modules\@babel\core\lib\config\config-descriptors.js:101:12
at Array.map (<anonymous>)
at createDescriptors (C:\Users\Gabriel\Projetos\danfy\functions\node_modules\@babel\core\lib\config\config-descripto
rs.js:100:27)
at createPresetDescriptors (C:\Users\Gabriel\Projetos\danfy\functions\node_modules\@babel\core\lib\config\config-des
criptors.js:92:10)
at C:\Users\Gabriel\Projetos\danfy\functions\node_modules\@babel\core\lib\config\config-descriptors.js:64:19
at presets (C:\Users\Gabriel\Projetos\danfy\functions\node_modules\@babel\core\lib\config\config-descriptors.js:54:2
5)
at mergeChainOpts (C:\Users\Gabriel\Projetos\danfy\functions\node_modules\@babel\core\lib\config\config-chain.js:293
:68)
at C:\Users\Gabriel\Projetos\danfy\functions\node_modules\@babel\core\lib\config\config-chain.js:246:7
at buildRootChain (C:\Users\Gabriel\Projetos\danfy\functions\node_modules\@babel\core\lib\config\config-chain.js:82:
20)
at loadConfig (C:\Users\Gabriel\Projetos\danfy\functions\node_modules\@babel\core\lib\config\index.js:50:53)
at transformSync (C:\Users\Gabriel\Projetos\danfy\functions\node_modules\@babel\core\lib\transform-sync.js:13:36)
at Object.transform (C:\Users\Gabriel\Projetos\danfy\functions\node_modules\@babel\core\lib\transform.js:20:65)
at transpile (C:\Users\Gabriel\Projetos\danfy\functions\node_modules\babel-loader\lib\index.js:55:20)
at Object.module.exports (C:\Users\Gabriel\Projetos\danfy\functions\node_modules\babel-loader\lib\index.js:179:20)
@ ./src/index.js 9:16-56
…/src/components/services/index.js
export * from './xml.service'
export * from './firebase.service'
export * from './validador.service'
export * from './calculador.service'
export * from './store.service'
export * from './assets.service'
export * from './globals'
Issue Analytics
- State:
- Created 6 years ago
- Reactions:29
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Preset files are not allowed to export objects - Stack Overflow
js Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions. Does anyone know how to solve this?
Read more >Plugin/Preset files are not allowed to export objects, only ...
I have installed @babel/preset-react. so I am having this error now. ERROR in ./main.js Module build failed (from ./node_modules/babel- ...
Read more >Fix plugin preset files are not allowed to export objects only ...
if you are facing this error “plugin preset files are not allowed to export objects only functions” The problem is mostly because of...
Read more >【React】webpackエラー解決方法"Plugin/Preset files are not ...
ERROR in ./src/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Plugin/Preset files are not allowed to ...
Read more >React Native: Plugin/Preset files are not allowed to export ...
I'm new to react-native and I'm trying to set up a project with mobx (using decorators), however I'm getting the following error when...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found a solution using
babelrc: false
under options. Using under query gaves and error.1+