解决关于: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" 是 ...
随机推荐
- H5采集pcm流转换采样率实时发送到服务端
function startTalk(ws2, button) { var arrBuffer = new ArrayBuffer(320 * 2); var sendBuffer = new Dat ...
- 【Mybatis】MyBatis之Sql配置文件的使用(四)
上一章[Mybatis]MyBatis对表执行CRUD操作(三),已经讲了基本操作,本章介绍Sql配置文件中常用功能 1.插入返回主键 2.参数值的获取方式 3.resultMap使用 插入返回主键 ...
- temp--内蒙农信出差
============================2018.09.18~~~20181001================================== -------住宿----黎明花 ...
- webpack踩坑--webpack 2.x升级至4.x
一.安装webpack-cli,webpack@4.26.1 1.npm install webpack-cli -D 2.npm install webpack@4.26.1 -D 二.踩坑 执行n ...
- REdis之RDB配置问题
RDB配置:save 900 1save 300 10save 60 10000stop-writes-on-bgsave-error nordbcompression yesrdbchecksum ...
- How Does Closure Work in Javascript?
Simply, closure is the scope that it can visite and operate the variables outside of the function wh ...
- OpenGIS
OpenGIS(Open Geodata Interoperation Specification,OGIS-开放的地理数据互操作规范)由美国OGC(OpenGIS协会,Open Geospatial ...
- Cookie的几点忠告
1.不要在COOKIE中保存明文的敏感信息 2.不要在COOKIE中保存永久的敏感信息,即每个COOKIE 都需要有时效性,过期则失效. 参考 XSS跨站攻击相关资料 http://www.cnblo ...
- bzoj3237(cdq+并查集)
这题一眼lct,然而 #include<iostream> #include<cstdio> #include<cmath> #include<cstring ...
- php中的冒泡排序和选择排序d
//冒泡算法 //定义一个数组 $arr=arr{2,5,1155,3,8}; $len=count($arr); for($i=0;$i<$len-1;$i++) //定义以下需要宣传的次数 ...