解决关于:TypeError: Class constructor Model cannot be invoked without 'new'
问题描述:在工作过程中出现 TypeError: Class constructor Model cannot be invoked without 'new' 这个错误
以下是报错代码:
class Users extends father{
constructor(data){
super(data);
}
····
}
版本信息
npm 5.0.3
node 8.9.0
错误原因:
es版本为 es2015 es5
解决方案:
打开 tsconfig.json文件
将es5 es2015 替换为es6 重新编译
此随笔乃本人学习工作记录,如有疑问欢迎在下面评论,转载请标明出处。
如果对您有帮助请动动鼠标右下方给我来个赞,您的支持是我最大的动力。
解决关于:TypeError: Class constructor Model cannot be invoked without 'new'的更多相关文章
- Appium 1.9.1 启动报错 Fatal TypeError: Class constructor BaseDriver cannot be invoked without 'new'
安装了appium 1.9.1后一直报错Fatal TypeError: Class constructor BaseDriver cannot be invoked without 'new',无法 ...
- atitit。解决 No suitable Log constructor。。NoClassDefFoundError: org/apache/log4j/Category 找不到类的
atitit.解决 No suitable Log constructor..NoClassDefFoundError: org/apache/log4j/Category 找不到类的 1. 深的层次 ...
- Python中错误之 TypeError: object() takes no parameters、TypeError: this constructor takes no arguments
TypeError: object() takes no parameters TypeError: this constructor takes no arguments 如下是学习python类时 ...
- vue-cli报错:Class constructor FileManager cannot be invoked without 'new'
bug:vue-cli3开发的项目,今天项目重新下载依赖启动项目的时候出现错误:Class constructor FileManager cannot be invoked without 'new ...
- Class constructor FileManager cannot be invoked without 'new'
bug:今天项目重新安装依赖打包的时候出现错误:Class constructor FileManager cannot be invoked without 'new' 解决:尝试了很多种解决方案, ...
- vue报错: Class constructor FileManager cannot be invoked without 'new'.
vue中报Class constructor FileManager cannot be invoked without 'new'.错处理: 原因:less 3.10 正式版报错 解决方法很简单,把 ...
- Ext4.0.7使用Ext.grid.ColumnModel报错:TypeError: Ext.grid.Model is not a constructor
代码如下: Ext.onReady(function(){ //定义列 var cm = new Ext.grid.ColumnModel([ {header: '编号', dataIndex: 'i ...
- 解决:TypeError: 'list' object is not callable
如果list变量和list函数重名,会有什么后果呢?我们可以参考如下代码: list = ['泡芙', '汤圆', '鱼儿', '骆驼'] tup_1 = (1, 2, 3, 4, 5) tupToL ...
- vue 报错解决:TypeError: Cannot read property '_t' of undefined"
前端报错如下: [Vue warn]: Error in render: "TypeError: Cannot read property '_t' of undefined" 是 ...
随机推荐
- 第二阶段第八次spring会议
昨天我对软件进行了植物网站的添加. 今天我将对软件进行宠物信息的添加. 清屏功能 private void button5_Click(object sender, EventArgs e) { te ...
- Idea搭建SpringMVC框架(初次接触)
公司转Java开发,做的第一个项目是SpringMVC框架,因为底层是同事封装,等完成整个项目,对SpringMVC框架的搭建还不是很了解,所以抽时间不忙的时候自己搭建了一个SpringMVC框架. ...
- Dom4j 封装DOM和SAX 的方法
Dom4j 封装DOM的解析XML文件的方法: List<Book> bookList=new ArrayList<Book>(); //1.1 建立一个解析器工厂: Docu ...
- 得到一个文件夹中所有文件的名称的几个方法(命令指示符, C++, python)
因为最近一直需要获得一个文件下的所有图片的名称,自己又总是跨平台使用,所以把自己在不同环境之下使用的方法总结如下 1.cmd 模式下 优点:简单 例如,我想将一个文件夹下的所有".jpg&q ...
- 关于get和post请求的区别
1.标准答案 GET在浏览器回退时是无害的,而POST会再次提交请求. GET产生的URL地址可以被Bookmark,而POST不可以. GET请求会被浏览器主动cache,而POST不会,除非手动设 ...
- 一些你不知道的PHP高级语法汇总
一.执行系统外部命令 system() 输出并返回最后一行shell结果. exec() 不输出结果,返回最后一行shell结果,所有结果可以保存到一个返回的数组里面. passthru() 只调用命 ...
- ios 国际化开发
一,.xib 1.首先选中xib文件,在右边的inspector中选择对应的国际化语言,如下图
- Solaris:你好奇的十件事
想想你周围的人,看看他们正在使用的操作系统.绝大部分人的电脑都在用主流操作系统:Windows,MacOS,甚至是Ubuntu.当说到Solaris,Unix和BSD的时候,其他人还以为你说鸟语呢.除 ...
- [译]迁移到新的 React Context Api
随着 React 16.3.0 的发布,context api 也有了很大的更新.我已经从旧版的 api 更新到了新版.这里就分享一下我(作者)的心得体会. 回顾 下面是一个展示如何使用旧版 api ...
- 换PHP7后访问Apache虚拟站点Forbidden的问题解决
Httpd.conf中,注释掉前2行,补上后2行 <Directory /> #AllowOverride none #Require all denied Order deny,allo ...