草庐IT

async_read

全部标签

javascript - Request-Promise 使用 async/await 抛出 "no auth mechanism defined"

我刚刚尝试使用request-promise进行async/await并遇到了这个错误:RequestError:Error:noauthmechanismdefinedatnewRequestError(node_modules/request-promise-core/lib/errors.js:14:15)atRequest.plumbing.callback(node_modules/request-promise-core/lib/plumbing.js:87:29)atRequest.RP$callback[as_callback](node_modules/request

javascript - Apollo "Subscription field must return Async Iterable. Received: undefined"

我有一个触发channel事件“countIncr”的突变,但我没有看到事件的相应订阅与事件负载一起触发。更新:我已经对这篇文章进行了多次更新,现在我正在更改标题以更能代表我所在的位置。我收到graphqlPlayground错误"SubscriptionfieldmustreturnAsyncIterable.Received:undefined"我遇到问题的TGRstack复制:https://github.com/TGRstack/tgr-apollo-subscription-example-microservice/没有TGRstack的工作再现:https://github

javascript - 使用 Jasmine async 测试 postMessage 不起作用

我正在尝试使用Jasmine2.0为AngularJS应用程序中的某些逻辑编写单元测试,但该逻辑位于事件监听器中。来自Controller:window.addEventListener('message',function(e){if(e.data==="sendMessage()"){$scope.submit();}},false);来自测试文件:describe("postmessage",function(){beforeEach(function(done){varcontroller=createController(controllerParams);spyOn($sc

javascript - Facebook Javascript SDK 未捕获类型错误 : Cannot read property 'userID' of undefined

我正在尝试使用FacebookJavaScriptSDK实现授权功能。当我运行它并检查控制台时,我看到了错误。uncaughtTypeError:Cannotreadproperty'userID'ofundefined代码片段varappId='APP_ID';varuid;//InitializetheJSSDKFB.init({appId:'413026618765431',cookie:true,});//Gettheuser'sUIDFB.getLoginStatus(function(response){uid=response.authResponse.userID?re

javascript - Bluebird PromisifyAll 没有任何 Async 后缀,即可以替换原始功能吗?

Bluebird有一个promisifyAll函数“通过遍历对象的属性并在对象及其原型(prototype)链上创建每个函数的异步等价物来Promisify整个对象。”它创建带有后缀Async的函数。是否可以完全替换旧功能?被替换的函数就像原始函数一样工作,此外它们还返回一个Promise,所以我认为完全替换旧函数应该是安全的。varobject={};object.fn=function(arg,cb){cb(null,1)};Bluebird.promisifyAll(object);object.fn//donotwantobject.fnAsync//=>shouldrepla

javascript - 类型错误 : Cannot read property 'latlng' of undefined

我正在尝试获取鼠标移动时的x,y坐标。我在尝试获取它时遇到错误。TypeError:Cannotreadproperty'latlng'ofundefinedatmouseMove(dashboard:593)atHTMLDivElement.onmousemove(dashboard:442)variMaxZoom=1;varmap=L.map('map',{crs:L.CRS.Simple,minZoom:-5,maxZoom:1});varbounds=[[0,0],[711,473]];varimage=L.imageOverlay('{!!asset('assets/imag

javascript - 如何使用 async/await 去抖动?

我有一个输入框。在用户停止输入后,我想执行一个HTTP请求并等待结果。Here'sajsbin由于jsbin不允许网络请求,因此我使用setTimeout()代替。varlog=console.log.bind(console)vardelayedResults=newPromise(function(resolve){setTimeout(function(){resolve('WoooIamtheresult!')},3000);});document.querySelector('input').addEventListener('input',_.debounce(asyncf

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

我明白了UncaughtTypeErroroccurs(UncaughtTypeError:Cannotreadproperty'__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED'ofundefined)当我使用ReactJS时 最佳答案 抛出错误是因为react-dom找不到React的实例。我想这与您使用res/build/react-min.js而不是res/build/react.min.jsreact-dom中函数名称的荣誉:(function(React){returnReact.

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 read property 'length' of undefined

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