草庐IT

language-properties

全部标签

javascript - 未捕获的类型错误 : Cannot read property 'then' of undefined using Sweet Alert

我正在使用SweetAlert2我收到以下错误UncaughtTypeError:Cannotreadproperty'then'ofundefined当我使用与SweetAlert页面中建议的完全相同的代码时。swal({title:'Areyousure?',text:"Youwon'tbeabletorevertthis!",type:'warning',showCancelButton:true,confirmButtonColor:'#3085d6',cancelButtonColor:'#d33',confirmButtonText:'Yes,deleteit!',canc

javascript - 获取行数据失败,错误 Cannot create property 'guid' on string

我正在使用jquery数据表。当我尝试检索行数据时,出现了Cannotcreateproperty'guid'onstring错误。http://jsfiddle.net/rqx14xepvaremployersTable=$('#employersTable').DataTable();$('#add').click(function(){addRow($('.username').val(),$('.phone').val());});$('body').on('click','#employersTabletr',retrieveRow(this));functionaddRow

javascript - react : Cannot set property 'lastEffect' of null

我在生产中遇到错误。看起来它与uglisifyWebpack插件有关我找不到解决方案来解决它。网络包配置:constUglifyJSPlugin=require("uglifyjs-webpack-plugin");module.exports={mode:"production",entry:"./index.tsx",resolve:{extensions:[".js",".tsx"]},module:{rules:[{test:/\.tsx?$/,use:{loader:"ts-loader",options:{transpileOnly:true}}}]},optimizati

javascript - 未捕获的类型错误 : Cannot read property 'length' of undefined

我有一个插件可以访问许多元素的length属性。但是,javascript控制台指向jquery.min.js的第12行。我如何回溯以找到我的插件中有问题的行? 最佳答案 如果您使用缩小的脚本,任何调试器(例如完全最好的Firebug)都会向您显示相同的问题行,并且此信息毫无用处(缩小的脚本难以阅读和理解,并且它们写在一行中)。解决此类问题的几种方法:正如我之前所说:为了开发而不是缩小脚本,调试器会向您显示有意义的行,如果您幸运的话,您可以找到非常有用的开发人员评论。如果找不到完整版本的脚本,请使用像这样的unminifier:ht

javascript - jQuery 中的 "Uncaught TypeError: cannot read property ' 长度 ' of null"

我正在定义在我的HTML上按下按钮时发生的以下操作:$(document).ready(function(){$("#query").keydown(function(){//stuff$.get(url,function(result){console.log(result);varlist="";for(vari=0,l=result["results"].length;i'+result["results"][i]["label"]+'';}list="Herearesomeresults:"+list+"";});});到达“结果”的是一个JSON数组,格式如下:{"resul

javascript - 为什么 Angular 5 Transition 抛出 AppComponent.html :2 ERROR TypeError: Cannot read property 'forEach' of undefined

为什么Angular5会抛出这个错误?AppComponent.html:2ERRORTypeError:Cannotreadproperty'forEach'ofundefined我正在研究Angular动画的概念验证,我直接使用网站上的代码。我的组件如下所示:import{Component,OnInit}from'@angular/core';import{trigger,state,style,transition,animate,keyframes}from'@angular/animations';@Component({selector:'app-obj-list',te

javascript - 未捕获的类型错误 : Cannot read property 'injection' of undefined

关闭。这个问题需要debuggingdetails.它目前不接受答案。编辑问题以包含desiredbehavior,aspecificproblemorerror,andtheshortestcodenecessarytoreproducetheproblem.这将有助于其他人回答问题。关闭4年前。Improvethisquestion升级到16.x后出现以下错误UncaughtTypeError:Cannotreadproperty'injection'ofundefinedatinjectTapEventPlugin(injectTapEventPlugin.js:23)ateva

javascript - 类型错误 : Cannot read property 'Roboto-Regular.ttf' of undefined

尝试使用JSAPIPdfMake构建PDF:然后根据thisHelloworld,我跑:vardocDef={content:'ThisisansamplePDFprintedwithpdfMake'}pdfMake.createPdf(docDef).download('optionalName.pdf');我遇到了这个错误:UncaughtTypeError:Cannotreadproperty'Roboto-Regular.ttf'ofundefined是否需要Roboto-Regular.ttf文件?如果是,放在哪里? 最佳答案

javascript - 误报 "Lexical declarations require ECMAScript 6"和 "TypeScript 1.x feature. Current language is 1.4"错误消息

在将TypeScript更新到版本1.7(目前最新版本)后,我一直看到Resharper指出错误,例如在使用namespace、const和let,即使这个版本的TypeScript应该支持它们。例如:TypeScript1.x功能。当前语言是1.4和词法声明(let和const)需要ECMAScript6编译器目标。当前目标是ECMAScript5。 最佳答案 我的Resharper(10.0.1)版本似乎无法检测到TypeScript版本。要解决此问题,您可以手动指定版本。由于此版本的Resharper(发布时为最新版本)不支持

javascript - 类型错误 : Cannot read property 'error' of undefined on React Chrome Extension

我正在使用React-Chrome-Reduxlibrary开发ReactChrome扩展我是第一次用这个开发,一直卡在错误中,不知道是什么原因。我的弹出式应用程序在运行时失败,并在控制台上显示以下错误消息:Errorineventhandlerfor(unknown):TypeError:Cannotreadproperty'error'ofundefined我尝试调试并在错误的确切位置设置断点:returnnewPromise(function(resolve,reject){chrome.runtime.sendMessage({type:_constants.DISPATCH_