未捕获错误:模板与旧版Handlebars预编译 [英] Uncaught Error: Template was precompiled with an older version of Handlebars
问题描述
我正在使用Bower来管理我的前端依赖关系,并将 grunt-ember-templates
预编译句柄模板。
这些是 bower.json
中的依赖项:
devDependencies :{
/ pre>
ember:〜1.3.1,
jquery:〜2.0.3,
normalize-css:〜2.1.3
jquery.cookie:〜1.4.0,
font-awesome:〜4.0.3
}
...和
package.json
:devDependencies:{
bower:〜1.2.8,
grunt:〜0.4.2,
grunt-contrib-copy:〜0.5.0,
grunt-contrib-clean:〜0.5.0,
grunt-contrib-concat 0.3.0,
handlebars:〜1.3.0,
ember-template-compiler:〜1.4.0-beta.1,
grunt- ember-templates:〜0.4.18
},
编译并运行我的Ember应用程序我收到这个错误:
断言失败:Ember Handlebars需要Handlebars版本1.0或1.1,COMPILER_REVISION预期:4,得到:5 - 请注意:主人的构建可能有其他COMPILER_REVISION值。
未捕获错误:模板与当前运行时的旧版本的Handlebars进行了预编译。请将您的预编译器更新到较新版本(> = 2.0.0),或将您的运行时间降级到较旧版本(<= $ 1.0 $ .rc.2)。
这些是版本:
> Ember.VERSION
> 1.3.2
> Handlebars.VERSION
> v2.0.0-alpha.1
如您所见
handlebars
没有被明确提及为依赖,而是通过Ember来解决。但是不知何故,它解决了一个较新的(不兼容的)版本。
如何修复
handlebars
?的版本? / p>
解决方案执行
bower install handlebars#1.3.0 --save
是的,这是凉亭的问题。我看到您创建了 https://github.com/bower/bower/issues/1114I'm using Bower to manage my frontend dependencies and
grunt-ember-templates
to precompile handlebars templates.These are the dependencies in
bower.json
:"devDependencies": { "ember": "~1.3.1", "jquery": "~2.0.3", "normalize-css": "~2.1.3", "jquery.cookie": "~1.4.0", "font-awesome": "~4.0.3" }
... and in
package.json
:"devDependencies": { "bower": "~1.2.8", "grunt": "~0.4.2", "grunt-contrib-copy": "~0.5.0", "grunt-contrib-clean": "~0.5.0", "grunt-contrib-concat": "~0.3.0", "handlebars": "~1.3.0", "ember-template-compiler": "~1.4.0-beta.1", "grunt-ember-templates": "~0.4.18" },
However, when I compile and run my Ember application I get this error:
Assertion failed: Ember Handlebars requires Handlebars version 1.0 or 1.1, COMPILER_REVISION expected: 4, got: 5 - Please note: Builds of master may have other COMPILER_REVISION values.
Uncaught Error: Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (>= 2.0.0) or downgrade your runtime to an older version (<= 1.0.rc.2).
And these are the versions:
> Ember.VERSION > "1.3.2" > Handlebars.VERSION > "v2.0.0-alpha.1"
As you see
handlebars
is not mentioned explicitly as a dependency, but is rather resolved through Ember. But somehow it resolves to a newer (incompatible) version.How do I fix the version of
handlebars
?解决方案Do
bower install handlebars#1.3.0 --save
, but yes this is a issue with bower. I saw you created https://github.com/bower/bower/issues/1114这篇关于未捕获错误:模板与旧版Handlebars预编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!