断言失败:所有浏览器中的对象(匿名函数)

时间:2016-02-25 11:13:46

标签: php jquery serialization handlebars.js marionette

我正在尝试调试我的应用程序没有正确前进的问题(昨天我离开时工作正常)而且它给我的是app.js中的以下错误(从控制台登录):

Assertion failed: Object(anonymous function) @ app.js:21
header.js:90 view:header@init-summary

即便如此,只有在添加以下内容后才能从RSVP库中抛出正确的错误:

RSVP.on('error', function(reason) {
    console.assert(false, reason);
});

代码库绝对庞大,几乎涵盖了当前使用的所有语言,从vanilla Javascript到Handlebars再到SQL到PHP等等,而且真正不清楚从哪里开始寻找导致错误的原因。

此阶段网络流量没有明显错误。任何人都可以协助解决我实际需要搜索的内容吗?显然我不打算发布整个代码库,但是如果人们需要任何额外的代码来帮助他们找出问题,并且可以证明为什么我非常乐意提供它,假设我可以找到一种方法来解决问题在不影响项目安全的情况下。

header.js的第90行是:

console.log('view:header@init-summary');

等待几分钟后,系统突然开始转换到应用程序的下一阶段,但在后续步骤中出现以下错误:

Assertion failed: Object {readyState: 4, responseText: "{"errors":   
[{"status":"404","code":0,"title":"Not Found"}]}", responseJSON: 
Object, status: 404, statusText: "Not Found"}(anonymous function) @ 
app.js:21lib$rsvp$events$$default.trigger @ rsvp.js:245(anonymous 
function) @ rsvp.js:779

Assertion failed: Object {readyState: 4, responseText: "{"errors":
[{"status":"404","code":0,"title":"Not Found"}]}", responseJSON:
Object, status: 404, statusText: "Not Found"}(anonymous function) @ 
app.js:21lib$rsvp$events$$default.trigger @ rsvp.js:245(anonymous 
function) @ rsvp.js:779 jquery.js:9664 PATCH    
http://localhost:4200/data/stub/proposal/PYXA5YVJ60N39T3J1QB8/relationfish    
/selected-fish 404 (Not Found)

在吃完午餐并回来后,应用程序开始步入第三阶段,出现以下错误:

Uncaught TypeError: Cannot read property 'get' of undefined

错误指向通用帮助程序库,但未指定从何处调用辅助程序库。

更新,现在返回以下错误:

PATCH     http://localhost:4200/data/stub/proposal/P9UZKZYXH92YFDUHGLUK/relationships
/selected-quote 404 (Not Found)send @ jquery.js:9664jQuery.extend.ajax 
@ jquery.js:9215Backbone.RelationalModel.saveRelationship @ json-
api.js:414Marionette.CompositeView.extend.saveApplication @ 
premiums.js:127Marionette.CompositeView.extend.submitStep @ 
premiums.js:118(anonymous function) @ 
backbone.marionette.js:2837triggerEvents @ backbone.js:370triggerApi @ 
backbone.js:357eventsApi @ backbone.js:155Events.trigger @ 
backbone.js:346Marionette.ItemView.extend.select @ 
premium.js:58jQuery.event.dispatch @ jquery.js:4670elemData.handle @ 
jquery.js:4338
jquery.js:9664 XHR finished loading: PATCH   
"http://localhost:4200/fishermen-wires.marionette/stub/proposal/P9UZKZYXH92YFDUHGLUK/relationships/selected-
quote".send @ jquery.js:9664jQuery.extend.ajax @ 
jquery.js:9215Backbone.RelationalModel.saveRelationship @ json-
api.js:414Marionette.CompositeView.extend.saveApplication @ 
premiums.js:127Marionette.CompositeView.extend.submitStep @ 
premiums.js:118(anonymous function) @ 
backbone.marionette.js:2837triggerEvents @ backbone.js:370triggerApi @ 
backbone.js:357eventsApi @ backbone.js:155Events.trigger @ 
backbone.js:346Marionette.ItemView.extend.select @ 
premium.js:58jQuery.event.dispatch @ jquery.js:4670elemData.handle @     
jquery.js:4338

并且正在Chrome中实例化第二个视图,但不会在Firefox或Safari中实例化。我已经硬盘重新加载,缓存清理并删除了Chrome中的Cookie。其他浏览器中没有缓存副本。

我使用WebStorm中的“在路径中查找”功能搜索了我的整个应用程序,并且我正在编写的应用程序中的任何一点都没有调用jQuery库,尽管另一个代码库可能通过代理调用它并且它看起来像如果库想要以不同的方式与我接口,那么基于中介在传递数据后与之通信的方式。

更新:现在逐步完成最后完成步骤之前的步骤(更多内容仍在写,但目前不是问题):

Uncaught Error: An "el" #policy-accept-terms must exist in DOM    
Marionette.Region.Marionette.Object.extend._ensureElement   @       
backbone.marionette.js:1231
Marionette.Region.Marionette.Object.extend.show @     
backbone.marionette.js:1089
Marionette.LayoutView.Marionette.ItemView.extend.showChildView  @     
backbone.marionette.js:3109
Marionette.LayoutView.extend.onRender   @   policy.js:79
(anonymous function)    @   backbone.marionette.js:685
Marionette.View.Backbone.View.extend.triggerMethod  @   
backbone.marionette.js:1939
Marionette.ItemView.Marionette.View.extend.render   @    
backbone.marionette.js:2089
Marionette.LayoutView.Marionette.ItemView.extend.render @
backbone.marionette.js:3092
Marionette.Region.Marionette.Object.extend._renderView  @
backbone.marionette.js:1215
Marionette.Region.Marionette.Object.extend.show @
backbone.marionette.js:1145
Marionette.LayoutView.Marionette.ItemView.extend.showChildView  @
backbone.marionette.js:3109
Controller.extend.policy    @   controller.js:117
_.extend.execute    @   backbone.js:1485
(anonymous function)    @   backbone.js:1473
(anonymous function)    @   backbone.js:1756
_.some._.any    @   underscore.js:258
_.extend.loadUrl    @   backbone.js:1754
_.extend.navigate   @   backbone.js:1816
_.extend.navigate   @   backbone.js:1490
Marionette.AppRouter.extend.goToStep    @   router.js:42
Marionette.AppRouter.extend.goToNext    @   router.js:74 
(anonymous function)    @   controller.js:66
triggerEvents   @   backbone.js:368
triggerApi  @   backbone.js:356
eventsApi   @   backbone.js:155
Events.trigger  @   backbone.js:346
(anonymous function)    @   backbone.marionette.js:691
Marionette.View.Backbone.View.extend.triggerMethod  @
backbone.marionette.js:1939
Marionette.ItemView.extend.submitStep   @   add-ons.js:95
jQuery.event.dispatch   @   jquery.js:4670
elemData.handle @   jquery.js:4338

这个错误看起来很明显且很容易解决,但是我没有在发生这个新错误消息之前对代码进行任何更改,甚至我修复它也很有可能一旦网站出现/ app上线完全相同的问题会以某种形式或其他形式重现

更新:今天早上来了,应用程序现在间歇性地显示:

Assertion failed: Objectabort: ( statusText )always: ()complete:   
()done: ()error: ()fail: ()getAllResponseHeaders: ()getResponseHeader: 
( key )overrideMimeType: ( type )pipe: ( /* fnDone, fnFail, fnProgress 
*/ )progress: ()promise: ( obj )readyState: 4responseText: "<br 
/>↵<b>Deprecated</b>:  Automatically populating $HTTP_RAW_POST_DATA is    
deprecated and will be removed in a future version. To avoid this 
warning set 'always_populate_raw_post_data' to '-1' in php.ini and use 
the php://input stream instead. in <b>Unknown</b> on line <b>0</b><br  
/>↵<br />↵<b>Warning</b>:  Cannot modify header information - headers 
already sent in <b>Unknown</b> on line <b>0</b><br />↵{"data":
{"type":"stub-proposal","id":"P8XSGIFHTDEX6GI6DQOT","attributes": 
{"add_ons":
{"legal_helpline":null,"new_for_old":null,"personal_accident":true}},"relationships":{"selected_quote":{"data":{"type":"insurance-    
quote","id":"QGZ7SLFNRR3BPOBNB7RB"}},"quotes":{"data":
[{"type":"insurance-quote","id":"QFRQ05MH3MYHNKEXQMV1"},
{"type":"insurance-quote","id":"Q9SLIOJLPQRVIQA31R0T"},  
{"type":"insurance-quote","id":"QGZ7SLFNRR3BPOBNB7RB"},
{"type":"insurance-quote","id":"QVSEVJ0BDC59DF19MICQ"}]}},"links":
{"self":"http:\/\/local.theinsuranceemporium.co.uk\/data\/stub\/proposal\/P
8XSGIFHTDEX6GI6DQOT"},"meta":{"current":false,"add_ons":
{"legal_helpline":{"title":"Legal Helpline","description":"If   
there\u0027s something strange, in your neighbourhood. Who you gonna 
call?","type":"toggle","premium":
{"frequency":"L","rate":"96.00"}},"new_for_old":{"title":"New for 
Old","description":"We\u0027ll replace new for 
old.","type":"toggle","premium":
{"frequency":"L","rate":"37.00"}},"personal_accident":  
{"title":"Personal Accident","description":"Are you clumsy? Why not get 
some personal accident cover?!","type":"toggle","premium":     
{"frequency":"L","rate":"99.00"}}}}},"included":[{"type":"insurance-
quote","id":"QFRQ05MH3MYHNKEXQMV1","attributes":
{"package":"0ARGUBXV2TAQ2RPF6VNF","definition":
{"title":"Gold","sub_title":null,"description":"Gold insurance from The      
Insurance Emporium. Our top level insurance."},"premium":  
{"frequency":"L","rate":"24.30","discounted_amount":"24.30","discount_percentage":"0"},"total":{"amount":"24.30","frequency":"L"},"discounts":    
[],"benefits":[{"identifier":"public_liability","meta_data":
{"title":"Public Liability","description":"It\u0027s really great to 
have some public liability 
cover.","add_on":false},"value":1500000,"value_type":"stub"}, 
{"identifier":"legal_helpline","meta_data":{"title":"Legal 
Helpline","description":"If there\u0027s something strange, in your 
neighbourhood. Who you gonna 
call?","add_on":true},"value_type":"stub"},
{"identifier":"new_for_old","meta_data":{"title":"New for Old
","description":"We\u0027ll replace new for 
old.","add_on":true},"value_type":"stub"},
{"identifier":"personal_accident","meta_data":{"title":"Personal  
Accident","description":"Are you clumsy? Why not get some personal 
accident cover?!","add_on":true},"value_type":"stub"}]}},
{"type":"insurance-quote","id":"Q9SLIOJLPQRVIQA31R0T","attributes":
{"package":"00DPKFR8CKOEHPYKSI8H","definition":
{"title":"Gold","sub_title":null,"description":"Gold insurance from The 
Insurance Emporium. Our top level insurance."},"premium":    {"frequency":"A","rate":"220.00","discounted_amount":"220.00","discount_per    centage":"0"},"total":{"amount":"220.00","frequency":"A"},"discounts":
[],"benefits":[{"identifier":"public_liability","meta_data":
{"title":"Public Liability","description":"It\u0027s really great to 
have some public liability 
cover.","add_on":false},"value":1500000,"value_type":"stub"},
{"identifier":"legal_helpline","meta_data":{"title":"Legal 
Helpline","description":"If there\u0027s something strange, in your 
neighbourhood. Who you gonna    
call?","add_on":true},"value_type":"stub"},
{"identifier":"new_for_old","meta_data":{"title":"New for 
Old","description":"We\u0027ll replace new for 
old.","add_on":true},"value_type":"stub"},
{"identifier":"personal_accident","meta_data":{"title":"Personal 
Accident","description":"Are you clumsy? Why not get some personal 
accident cover?!","add_on":true},"value_type":"stub"}]}},
{"type":"insurance-quote","id":"QGZ7SLFNRR3BPOBNB7RB","attributes":
{"package":"0ZOQVO9WAF9QL34TBGE0","definition":
{"title":"Silver","sub_title":"Better than 
Bronze","description":"Silver insurance from The Insurance Emporium. 
Our mid-level insurance."},"premium": 
{"frequency":"L","rate":"36.30","discounted_amount":"36.30","discount_perce    ntage":"0"},"total":{"amount":"36.30","frequency":"L"},"discounts":     
[],"benefits":[{"identifier":"public_liability","meta_data":
{"title":"Public Liability","description":"It\u0027s really great to 
have some public liability     
cover.","add_on":false},"value":1500000,"value_type":"stub"},
{"identifier":"legal_helpline","meta_data":{"title":"Legal 
Helpline","description":"If there\u0027s something strange, in your 
neighbourhood. Who you gonna 
call?","add_on":true},"value_type":"stub"},
{"identifier":"new_for_old","meta_data":{"title":"New for 
Old","description":"We\u0027ll replace new for 
old.","add_on":true},"value_type":"stub"},
{"identifier":"personal_accident","meta_data":{"title":"Personal 
Accident","description":"Are you clumsy? Why not get some personal 
accident cover?!","add_on":true},"value_type":"stub"}]}},
{"type":"insurance-quote","id":"QVSEVJ0BDC59DF19MICQ","attributes":
{"package":"0P5K73S8WS1GZ83GIQ5A","definition":
{"title":"Silver","sub_title":"Better than 
Bronze","description":"Silver insurance from The Insurance Emporium. 
Our mid-level insurance."},"premium":
{"frequency":"A","rate":"395.00","discounted_amount":"395.00","discount_percentage":"0"},"total":{"amount":"395.00","frequency":"A"},"discounts":    [],"benefits":[{"identifier":"public_liability","meta_data":    
{"title":"Public Liability","description":"It\u0027s really great to have some public liability   
cover.","add_on":false},"value":1500000,"value_type":"stub"},
{"identifier":"legal_helpline","meta_data":{"title":"Legal 
Helpline","description":"If there\u0027s something strange, in your 
neighbourhood. Who you gonna 
call?","add_on":true},"value_type":"stub"},
{"identifier":"new_for_old","meta_data":{"title":"New for 
Old","description":"We\u0027ll replace new for 
old.","add_on":true},"value_type":"stub"},
{"identifier":"personal_accident","meta_data":{"title":"Personal 
Accident","description":"Are you clumsy? Why not get some personal 
accident cover?!","add_on":true},"value_type":"stub"}]}}]}
↵"setRequestHeader: ( name, value )state: ()status: 200statusCode: (  
map )statusText: "OK"success: ()then: ( /* fnDone, fnFail, fnProgress 
*/ )__proto__: Object(anonymous function) @ :4200/app/app.js:21

实例化第一个视图,并在单步执行第二个视图时间歇性地显示Patch错误(上面列出)。同样,在此期间,我自己也没有改变任何代码。

附加信息:我们有一个MongoDB以及一个SQL和不同的应用程序保存到不同的地方 - 我认为我的实际上是通过两个atm ?????我们在用RPG编写的AS400上也有很多东西,还有一个业务逻辑层,它也是一个资产库。

附加信息更新:我在母网站HTML中找到了一个jQuery引用,如下所示:

<script type="text/javascript" src="vendor/jquery.js"></script>

图书馆是从着陆页调用的,而不是require d in with node或RequireJS,这就是我无法在自己的应用程序中找到它的原因。

0 个答案:

没有答案