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. No plugin found for prefix 'war' in the current project and in the plugin groups

    解决办法: 在pom里面添加 : <dependency> <groupId>org.apache.maven.plugins</groupId> <arti ...

  2. Apache2.4+PHP7.2环境搭建

    Editplus生成码:http://www.jb51.net/tools/editplus/ 阿帕奇下载地址:https://www.apachehaus.com/cgi-bin/download. ...

  3. Django学习之路由系统

    一.Django的路由系统 1.URLconf配置 基本格式: 参数说明: 2.正则表达式详解 基本配置 注意事项 补充说明 3.分组命名匹配 URLconf匹配的位置 捕获的参数永远都是字符串 视图 ...

  4. CSS - 层叠上下文(The stacking context)

    对 MDN 的上的例子的拓展 Root - DIV #1(z-index: 5) - DIV #2(z-index: 2) - DIV #3(z-index: 4) - DIV #4(z-index: ...

  5. Krypton Suite of .NET WinForms Controls

    The Krypton Suite of .NET WinForms controls are now freely available for use in personal or commeric ...

  6. MVC 源码系列之控制器执行(一)

    控制器的执行 之前说了Controller的激活,现在看一个激活Controller之后控制器内部的主要实现. public interface IController { void Execute( ...

  7. TensorFlow学习笔记6-数值计算基础

    TensorFlow学习笔记6-数值计算 本笔记内容为"数值计算的基础知识".内容主要参考<Deep Learning>中文版. \(X\)表示训练集的矩阵,其大小为m ...

  8. FileSystemObject详解

    FSO是FileSystemObject 或 Scripting.FileSystemObject 的缩写,为 IIS 内置组件,用于操作磁盘.文件夹或文本文件.FSO 的对象.方法和属性非常的多,这 ...

  9. python基础-11 socket,IO多路复用,select伪造多线程,select读写分离。socketserver源码分析

    Socket socket通常也称作"套接字",用于描述IP地址和端口,是一个通信链的句柄,应用程序通常通过"套接字"向网络发出请求或者应答网络请求. sock ...

  10. jdk下载安装后为什么要设置环境变量?

    因为电脑不知道javac这个命令是在C:\Program Files\JAVA\jdk1.8.0_65\bin的这个路径下面,所以我们要设置好环境变量,来让电脑知道其路径