解决关于: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" 是 ... 
随机推荐
- python3 第二十五章 - comprehensions(推导式)
			推导式(又称解析式),是Python的一种独有特性.推导式是可以从一个数据序列构建另一个新的数据序列的结构体. 共有三种推导,在Python2和3中都有支持: 列表(list)推导式 字典(dict) ... 
- java中的Condition协作线程接口类
			在Java的Condition接口中,存在的几个方法跟Synchronized中的wait(),waitall(),wait(time ^),这个几个方法一一对应起来,但是在Lock.newCondi ... 
- Ajax使用的五步法
			Ajax使用的五步法 <script type="text/javascript"> //用于保存XMLHttpRequest对象的变量,由于整个过 ... 
- 转载  linux基本操作
			转载地址 https://segmentfault.com/a/1190000014840829 前言 只有光头才能变强 这个学期开了Linux的课程了,授课的老师也是比较负责任的一位.总的来说也算是 ... 
- Centos 7 下安装 Docker
			docker目前只支持Centos 7及以后的版本,系统要求:64位,内核版本至少在3.10及以后版本. 第一步: 添加软件源,安装依赖软件包以方便对devicemapper存储的 ... 
- vue-cli 第二章 (常见问题修正)
			一.编译打包多出 *.map 文件处理 当执行 npm run build 后根目录下会编译出一个 dist 的文件夹,如下: 其中 css 和 js 文件夹下会多出一些 *.map 的 ... 
- 初识STM32中的USMART组件
			今天看了usmart那部分的模块,感觉使我们stm32的学习变更加方便,你可以通过串口查看和检验你所注册过的函数. USMART配步骤1.将USMART包添加到工程中,头文件要包括path2.添加所需 ... 
- android与php使用base64加密的字符串结果不一样解决方法
			base64将字符串转换为字节得到同一个值 一.错误 String signString = Base64.encodeToString(signContent.getBytes(),Base64.N ... 
- git遇到的问题-- Another git process seems to be running in this repository
			执行git add .时,报错 fatal: Unable to create '/Users/lily/ForWork/forReBaomai/bm-fe/.git/index.lock': Fil ... 
- Django学习(一)连接mysql
			python3.6 Django2.0 几个改动的点: 1)setting: 2)__init__.py import pymysql 然后再重启server python manage.py run ... 
