HandlebarsHelper compiled templates tempateSpec.call undefined

I have a problem with the HandlebarsHelper compiled templates on the MVC5 site. Here is the code for the BundleConfig:

bundles.Add(new Bundle("~/bundles/templates", new HandlebarsTransformer())
            .IncludeDirectory("~/App/templates", "*.hbs", true));

      

This worked fine locally and then I pushed to the server that hosted the QA environment and I was getting an assembly link error where the HandlebarsHelper plugin was calling Jurassic 2.1.0.0 and it was not found. So I added Jurassia via Nuget, since then the templates have stopped working. I am getting this error from browser:

Chrome: Uncaught TypeError: undefined is not a function

Firefox: TypeError: templateSpec.call is not a function

This happens in the next section of handlebars.js:

return function(context, options) {
  options = options || {};
  var namespace = options.partial ? options : env,
      helpers,
      partials;

  if (!options.partial) {
    helpers = options.helpers;
    partials = options.partials;
  }
  var result = templateSpec.call(
        container,
        namespace, context,
        helpers,
        partials,
        options.data);

  if (!options.partial) {
    env.VM.checkRevision(container.compilerInfo);
  }

  return result;
};

      

I am running:

Ember 1.7.0 Ember-Data 1.0.0-beta.11 Steering Rack 1.3.0 JQuery 2.1.1

MVC 5 .Net 4.5.2

I've searched online all morning and still haven't found any answers that worked, I tried to uninstall the Jurassic Nuget package and it didn't help. Any ideas would be appreciated, let me know if there is any other information to help diagnose the problem.

+3


source to share


2 answers


You are using a version of HandlbarsHelper that is not supported for this version of Ember.js.

There was a bug in version 1.9 that added support for version 2.0 rudders. This is supported in HandlebarsHelper v2.0+. As the interrupt change means 2.0+ cannot be used with Ember.JS <v1.9 and Handlebars <v2.0.



The reason it probably worked initially was because the debug templates are usually just injected into the unminified page.

Easy fix is ​​to use HandlebarsHelper v1.1 ( https://www.nuget.org/packages/HandlebarsHelper/1.1.0 )

0


source


The problem was that I was using a version of Handlebars Helper that only supported the supported handlebars 2.x. Found a question in Nuget and changed it to a different version, everything works now. Thanks for the comments.



0


source







All Articles