Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to solve Rails environment difference? Works in staging but not in dev
    text
    copied!<p>I have dashboards that are in a backbone.js app in a larger Rails app. In staging and production (on heroku) the dashboards work fine. </p> <p>However, in my local Pow dev environment I get the following error in the browser console when I try and view a specific dashboard:</p> <pre><code>Uncaught TypeError: Object #&lt;Object&gt; has no method 'merge' </code></pre> <p>After tracking that down a bit, here is what I came up with. The merge method being referred to in the error message is coming from the rendered /assets/templates/dashboard/details.js file. Here is the code with what the browser is calling the error at the start of line 5: helpers = this.merge...:</p> <pre><code>(function() { this.HandlebarsTemplates || (this.HandlebarsTemplates = {}); this.HandlebarsTemplates["dashboard/details"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { this.compilerInfo = [4,'&gt;= 1.0.0']; helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression; buffer += "&lt;p&gt;\n &lt;b&gt;Name:&lt;/b&gt;\n &lt;span class='editable' data-attribute-name='name'&gt;"; 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) + "&lt;/span&gt;\n&lt;/p&gt;\n&lt;p&gt;\n &lt;b&gt;Description:&lt;/b&gt;\n &lt;span class='editable' data-attribute-name='description'&gt;"; 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) + "&lt;/span&gt;\n&lt;/p&gt;\n&lt;p&gt;\n &lt;button class='add_module'&gt;Add module&lt;/button&gt;\n&lt;/p&gt;\n"; return buffer; }); return this.HandlebarsTemplates["dashboard/details"]; }).call(this); </code></pre> <p>I think this is a Rails precompile or asset pipeline setup issue since it works fine in staging and production but fails in local development. </p> <p>It sucks having to push any changes to heroku to test them. Any suggestions for solving this are appreciated. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload