backbone.js - How to solve Rails environment difference? Works in staging but not in dev -


i have dashboards in backbone.js app in larger rails app. in staging , production (on heroku) dashboards work fine.

however, in local pow dev environment following error in browser console when try , view specific dashboard:

uncaught typeerror: object #<object> has no method 'merge'  

after tracking down bit, here came with. merge method being referred in error message coming rendered /assets/templates/dashboard/details.js file. here code browser calling error @ start of line 5: helpers = this.merge...:

(function() {   this.handlebarstemplates || (this.handlebarstemplates = {});   this.handlebarstemplates["dashboard/details"] = handlebars.template(function (handlebars,depth0,helpers,partials,data) {   this.compilerinfo = [4,'>= 1.0.0']; helpers = this.merge(helpers, handlebars.helpers); data = data || {};   var buffer = "", stack1, functiontype="function", escapeexpression=this.escapeexpression;   buffer += "<p>\n  <b>name:</b>\n  <span class='editable' data-attribute-name='name'>";   if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }   else { stack1 = depth0.name; stack1 = typeof stack1 === functiontype ? stack1.apply(depth0) : stack1; }   buffer += escapeexpression(stack1)     + "</span>\n</p>\n<p>\n  <b>description:</b>\n  <span class='editable' data-attribute-name='description'>";   if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }   else { stack1 = depth0.description; stack1 = typeof stack1 === functiontype ? stack1.apply(depth0) : stack1; }   buffer += escapeexpression(stack1)     + "</span>\n</p>\n<p>\n  <button class='add_module'>add module</button>\n</p>\n";   return buffer;   });   return this.handlebarstemplates["dashboard/details"]; }).call(this); 

i think rails precompile or asset pipeline setup issue since works fine in staging , production fails in local development.

it sucks having push changes heroku test them. suggestions solving appreciated.

it looks resulting handlebars version being out of date. thoughtbot guys helping track down.

https://github.com/wycats/handlebars.js/issues/547


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -