Thursday, January 16, 2014

data-dojo-props="onClick: dojo.hitch(this, this.delete)" ...breaking in Google Chrome 32.0.1700.76 but not Google Chrome 31.0.1650.63.

This dojo error materialized when there was no a "delete" method in the controller. The view was being used by a controller that managed an "update" CRUD screen and also a controller that managed a "create" CRUD screen. In the create scenario there was no delete method because we were just hiding the delete button which did not make sense in that circumstance. Google Chrome 31.0.1650.63 didn't care but Google Chrome 32.0.1700.76 did. We got a big stack trace error mess which meant a lot of nothing to us. This is something I find frustrating about both Dojo and AngularJS: opaque errors. Something goes inside of the thousands of lines of .js framework code, bounces around, and dies eventually while only surfacing an error that is not helpful at all.

Addendum: A coworker updated "delete" to be "destroy" to avoid a conflict with a JavaScript keyword. I don't know if this really bettered the problem or not. It was smart either way.

No comments:

Post a Comment