当前位置:网站首页>Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.
Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.
2022-07-21 17:25:00 【奔跑的痕迹】
运行项目是提示Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions.
原来是babel版本兼容问题
修改为
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "7.2.3",
"babel-loader": "^7.1.2",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2015-loose": "^8.0.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-1": "^6.24.1",
将高版本的babel配置做降级修改:
同步降级为:
{
"presets": [
["es2015", {
"loose": true }],
"stage-1",
"react"
],
"plugins": ["transform-decorators-legacy", "react-hot-loader/babel"]
}
重新 npm run dev 问题解决
边栏推荐
猜你喜欢
指针深度解刨《二》(指针指向自己)
Pointer summary
Machine learning by Li Hongyi 5 Tips for neural network design
解决IDEA的插件中心连接不上网络
MySQL transaction
vscode 配置代码自动格式化加修复
科技创造价值 | 云扩科技荣登真榜·中国科技创新品牌榜TOP100
Redis' classic three questions and sentinel
Linear table * sequential table (7000 words detailed explanation)
Self study golang [Chapter 3: the first go language program] use GoLand to create the first go program, the main function and init function, and use go to run Windows commands and realize the data out
随机推荐
Self study golang [Chapter 3: the first go language program] use GoLand to create the first go program, the main function and init function, and use go to run Windows commands and realize the data out
基礎不牢地動山搖之牛客刷題《二》
Vs2022 cannot use the solution of scanf, 'scanf': this function or variable may be unsafe Consider using scanf_ s instea
FastJson、JackJson处理时间、日期问题注意事项
Update the version number and static resources (the storage address of the embedded web page)
刨根问底丨落后的技术,能否造出好卖的产品?
C#异常处理 | 连接成功但登陆异常/管道另一端上无任何进程Error: A connection was successfully established with the server, but
ASP.NET Core部署手册:2.Hyper-V虚拟机
js bind
Science and technology create value | cloud expansion technology is listed in the real list · top 100 of China's scientific and technological innovation brands list
量化交易日记-2021年01月总结
OSPF 重发布
MySQL transaction
Pytoch learning (I) Deep learning review and introduction to pytoch
[C语言] 文件操作《一》
量化交易中通过均线系统判断上涨(下跌)动能减弱
Collection and map summary
Zhang Chi Consulting: How Six Sigma can help companies reduce customer complaints
vscode 配置代码自动格式化加修复
TPS trading strategy with a winning rate of 93.98%