1、产生原因:项目不支持装饰器

2、解决方法:

  2.1 执行

yarn

  安装完整依赖;

  2.2 如果依赖时yarn.lock变化了,并且项目有git目录,则将提示的文件提交到git仓库  

? Are you sure you want to eject? This action is permanent. Yes
This git repository has untracked files or uncommitted changes: yarn.lock

  

  2.3 执行:

yarn eject

  

  2.4 执行

yarn add @babel/plugin-proposal-decorators

  安装装饰器驱动

  2.5 将package.json中的babel依赖修改为:

"babel": {
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
],
"presets": [
"react-app"
]
},

  

  2.6 执行项目即可。

yarn start

  

Support for the experimental syntax 'decorators-legacy' isn't currently enabled (7:1):的更多相关文章

  1. Support for the experimental syntax 'classProperties' isn't currently enabled

    项目中使用高级语法报错, 报错信息 SyntaxError: E:\workdata\webpackVue\src\index.js: Support for the experimental syn ...

  2. error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler op

    caffe c++11编译问题 问题:error: #error This file requires compiler and library support for the ISO C++ 201 ...

  3. 解决Webpack中提示syntax 'classProperties' isn't currently enabled的错误

    当我们使用了一些JavaScript的一些新特性的时候,但是有没有在webpack.config.js里面或者是.babelrc文件中配置相关插件,就可以解决了. error:Support for ...

  4. 七天接手react项目 系列 —— 尾篇(antd 和 mobx)

    其他章节请看: 七天接手react项目 系列 尾篇 前面我们依次学习了 react 基础知识.react 脚手架创建项目.react 路由,已经花费了不少时间,但距离接手 spug_web 项目还有一 ...

  5. ES6入门一:ES6简介及Babel转码器

    ES6简介 Babel转码器 Nodejs中使用ES6 WebPack中使用ES6及Babel转码插件 一.ES6简介与转码  1.1一个常见的问题,ECMAScript和JavaScript到底是什 ...

  6. ES6入门六:class的基本语法、继承、私有与静态属性、修饰器

    基本语法 继承 私有属性与方法.静态属性与方法 修饰器(Decorator) 一.基本语法 class Grammar{ constructor(name,age){ //定义对象自身的方法和属性 t ...

  7. create-react-app 构建的项目使用 mobx (说到底就是为了使用装饰器语法对 babel 做些配置

    在 create-react-app 命令行构建的 React 项目中使用 Mobx 会出现如下警告: Support for the experimental syntax 'decorators- ...

  8. create-react-app下的@修饰器正确的使用方式记录

    在create-react-app下使用es7的@修饰器会报错''Support for the experimental syntax 'decorators-legacy' isn't curre ...

  9. [react]react创建app,路由,mobx 全教程

    ​ 1.创建app, npx create-react-app my-app Cmd Copy 2.进入项目目录 cd my-app Cmd Copy 3.启用配置文件(默认是不开启配置文件的) ya ...

随机推荐

  1. RabbitMQ绑定、队列、消息、虚拟主机详解(五)

    Binding:绑定,Exchange和Exchange.Queue之间的连接关系 Binding中可以包含RoutingKey或者参数 Queue:消息队列,实际存储消息数据 Durability: ...

  2. Solr搜索引擎基础

    搜索引擎是指一个庞大的互联网资源数据库,如网页,新闻组,程序,图像等.它有助于在万维网上定位信息. 用户可以通过以关键字或短语的形式将查询传递到搜索引擎中来搜索信息. 搜索引擎然后搜索其数据库并向用户 ...

  3. Splinter 的认识和基础应用

    Splinter 是一个使用Python开发的开源web应用测试程序,它可以帮助我们实现自动浏览站点和与其进行交互.它是依赖于其它python插件或拓展进行的,所以我们使用它之前需要安装一系列的依赖包 ...

  4. MySQL高可用架构之MySQL5.7.19 PXC

    CentOS7.3下Percona-XtraDB-Cluster-5.7.19集群部署PXC三节点安装:node1:10.10.10.11 node2:10.10.10.12node3:10.10.1 ...

  5. mysql-c++连接

    1.mysql-c++连接MySQL :: Download Connector/C++ https://dev.mysql.com/downloads/connector/cpp/ 1-1VS201 ...

  6. R 时间戳转化

    转 http://stackoverflow.com/questions/1962278/dealing-with-timestamps-in-r You want the (standard) PO ...

  7. SpringBoot 切换国际化

    git:https://github.com/xiaozhuanfeng/demoProj 代码结构: application.properties: spring.messages.basename ...

  8. 解决旋转屏幕闪退在androidManifest.template.xml里,activity项添加:

     解决旋转屏幕闪退在androidManifest.template.xml里,activity项添加:android:configChanges="orientation|keyboard ...

  9. KETTLE——(一)资源库

    对KETTLE有了大概的了解,pdi-ce-6.0.1.0-386也下载完成了. 1.解压pdi-ce-6.0.1.0-386.zip文件,双击运行Spoon.bat(KETTLE是Java开发的,运 ...

  10. 【ABAP系列】SAP ABAP 模拟做成像windows一样的计算器

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP ABAP 模拟做成像wind ...