Support for the experimental syntax 'decorators-legacy' isn't currently enabled 异常解决
问题描述:为React项目添加装饰器的时候“@”符号无法进行转议处理
解决方案:
1. 执行git add .
git add .
2.执行git commit -am "Save"
git commit -am "Save"
tips:执行这步作用就是把之前的默认配置全部暴露出来,从而可以修改webpack的配置
3.执行npm install --save-dev babel-plugin-transform-decorators-legacy
npm install --save-dev babel-plugin-transform-decorators-legacy
4.执行npm install --save-dev @babel/plugin-proposal-decorators
npm install --save-dev @babel/plugin-proposal-decorators
5.执行npm install --save-dev @babel/plugin-proposal-class-properties
npm install --save-dev @babel/plugin-proposal-class-properties
6.打开根目录的package.json文件,在babel中修改plugins,配置如下:
"babel": {"plugins": [["@babel/plugin-proposal-decorators",{"legacy": true}],["@babel/plugin-proposal-class-properties",{"loose": true}]],"presets": ["react-app"]}
Support for the experimental syntax 'decorators-legacy' isn't currently enabled 异常解决相关推荐
- Support for the experimental syntax ‘decorators‘ isn‘t currently enabled
webpack学习 babel的配置文件有问题,在敲配置文件时注意 一定要放在根目录 具体配置查看 https://babeljs.io/
- Support for the experimental syntax ‘classProperties‘ isn‘t currently enabled
环境 React 16.13 出错信息: 出错的原因: Support for the experimental syntax 'classProperties' isn't currently en ...
- 【异常】前端Babel提示 Support for the experimental syntax ‘jsx‘ isn‘t currently enabled
一.报错内容 17:33:41 - Building for production... 17:34:13 ERROR Failed to compile with 5 errors5:34:09 P ...
- 关于报错Support for the experimental syntax ‘decorators-legacy‘ isn‘t currently enabled
报错原因 装饰器写法不被支持 解决办法 bable转码 npm install @babel/plugin-proposal-decorators 配置package.json "babel ...
- Support for the experimental syntax 'dynamicImport' isn't currently enabled
在研究vue代码中动态加载组件遇到这样的问题,记录解决方法: 1.安装@babel/plugin-syntax-dynamic-import yarn add @babel/plugin-syntax ...
- javax.mail.MessagingException: 501 Syntax: HELO hostname Linux端异常解决
javax.mail.MessagingException: 501 Syntax: HELO hostname Linux端异常解决 参考文章: (1)javax.mail.MessagingExc ...
- syntax error near unexpected token 脚本报错误解决【转】
第一种方法失败了,win的文本自带^M的确是问题 原创 syntax error near unexpected token 脚本报错误解决 2018-03-14 21:25:53 會飛的土豆 阅读数 ...
- Failed resolution of: Landroid/support/v7/internal/widget/TintManager;异常解决方法
编译以下包的时候 compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:support-v4:2 ...
- com.alibaba.druid.sql.parser.ParserException: syntax error, QUES %, pos 80 like报错解决
最近,把各应用的jdbc连接池统一从dbcp2改成了druid,运行时druid报sql解析错误,如下: select * from test where 1=1 ...
最新文章
- c语言编程 构建围墙,c语言程序设计朝盛 综合程序练习题.ppt
- 如何修复 Flutter 中的“正在检查 Dart SDK 版本... << 此时出乎意料”错误?
- 采用SwipeFreshLayout+Recyclerview实现下拉刷新和上拉加载更多以及CoordinatorLayout的引入
- 最长回文子串Python解法
- .net mysql 特殊字符转义字符_MySQL 特殊字符转义问题
- keil4编译c语言,用keil4编译C语言代码,编译通过,但是链接时无法产生.hex文件。...
- redis 分页_Redis排行榜的设计与实现
- Oracle 备份及恢复
- 重庆声光电安全预警平台项目启动会顺利召开
- 搜狗PR权重是什么?搜狗PR权重如何查询?
- Java读取Excel,03版本和07版本
- 生产计划管理软件功能是什么?对生产管理有何好处?
- Vue一个案例引发「内容分发slot」的最全总结
- 打开word时提示需要安装包gaozhi.msi
- taobao wap session
- 布袋除尘器过滤风速多少_布袋除尘器过滤风速的选择!
- ffmpeg sws_scale函数的用法
- 使用c语言实现的fifo程序,C语言实现标准FIFO
- 熊海CMS 1.0代码审计漏洞集合
- 自主练习:BBS电子布告栏