After upgrading to Ember.js 1.13.2 from 1.10.beta4 we are no longer able to precompile Handlebars templates which have deprecation warnings in production. Please see the error and traceback for rake assets:precompile below. Oddly, we don't get any error on a Mac in production environment, but it fails on our Linux build server (Ubuntu.)
On investigation, it appears that ember-template-compiler.js generates deprecation warnings during precompile which get mixed with the compiled output. There is a comment in this JS file, "Ember build tools will remove any calls to Ember.deprecate()
when doing a production build." But I don't know how this works with the Sprockets tool chain. I cannot override Ember.deprecate since no application.js file gets included during precompile. If someone can say how calls to Ember.deprecate get removed in Rails assets precompile, it would help to debug this further.
We do need to get rid of the deprecations but it might take some time! Thanks for your help with this issue.
Version info (we don't use ember-cli):
- Rails 4.2.0
- ember-rails gem 0.16.1
- barber gem 0.9.0
- ember-template-compiler.js 1.13.2
Error message and trace:
RAILS_ENV=production bundle exec rake assets:precompile
...
rake aborted!
JSON::ParserError: 757: unexpected token at 'DEPRECATION: The `bind-attr` helper (L1:C7) is deprecated in favor of HTMLBars-style bound attributes.
{anonymous}(/tmp/execjs20150630-36511-b2stmyjs:15523:15)
Walker.visit (/tmp/execjs20150630-36511-b2stmyjs:22029:7)
visitors.Program (/tmp/execjs20150630-36511-b2stmyjs:22039:16)
Walker.children (/tmp/execjs20150630-36511-b2stmyjs:22062:7)
Walker.visit (/tmp/execjs20150630-36511-b2stmyjs:22030:12)
TransformBindAttrToAttributes_transform [as transform] (/tmp/execjs20150630-36511-b2stmyjs:15518:12)
preprocess (/tmp/execjs20150630-36511-b2stmyjs:21637:27)
compileSpec (/tmp/execjs20150630-36511-b2stmyjs:16640:52)
["ok","(function() {\ ...
... locals: [],\n templates: []\n };\n}())"]'
(in /var/lib/jenkins/jobs/ch_master_package/workspace/app/assets/javascripts/templates/_permanently_remove_post.hbs)
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/json-1.8.2/lib/json/common.rb:155:in `parse'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/json-1.8.2/lib/json/common.rb:155:in `parse'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:68:in `extract_result'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:39:in `exec'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:21:in `eval'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:46:in `call'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/barber-0.9.0/lib/barber/precompiler.rb:23:in `compile'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/barber-0.9.0/lib/barber/precompiler.rb:8:in `compile'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/ember-rails-0.16.1/lib/ember/handlebars/template.rb:75:in `precompile_ember_handlebars'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/ember-rails-0.16.1/lib/ember/handlebars/template.rb:27:in `evaluate'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/context.rb:197:in `block in evaluate'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/context.rb:194:in `each'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/context.rb:194:in `evaluate'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/processed_asset.rb:12:in `initialize'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:374:in `new'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:374:in `block in build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:395:in `circular_call_protection'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:373:in `build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/index.rb:94:in `block in build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/caching.rb:58:in `cache_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/index.rb:93:in `build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:287:in `find_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/index.rb:61:in `find_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/processed_asset.rb:111:in `block in resolve_dependencies'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/processed_asset.rb:105:in `each'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/processed_asset.rb:105:in `resolve_dependencies'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/processed_asset.rb:97:in `build_required_assets'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/processed_asset.rb:16:in `initialize'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:374:in `new'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:374:in `block in build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:395:in `circular_call_protection'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:373:in `build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/index.rb:94:in `block in build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/caching.rb:58:in `cache_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/index.rb:93:in `build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:287:in `find_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/index.rb:61:in `find_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/processed_asset.rb:111:in `block in resolve_dependencies'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/processed_asset.rb:105:in `each'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/processed_asset.rb:105:in `resolve_dependencies'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/processed_asset.rb:97:in `build_required_assets'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/processed_asset.rb:16:in `initialize'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:374:in `new'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:374:in `block in build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:395:in `circular_call_protection'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:373:in `build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/index.rb:94:in `block in build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/caching.rb:58:in `cache_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/index.rb:93:in `build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:287:in `find_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/index.rb:61:in `find_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/bundled_asset.rb:16:in `initialize'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:377:in `new'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:377:in `build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/index.rb:94:in `block in build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/caching.rb:58:in `cache_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/index.rb:93:in `build_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/base.rb:287:in `find_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/index.rb:61:in `find_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:211:in `block in find_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:257:in `benchmark'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:210:in `find_asset'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:119:in `block in compile'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:118:in `each'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:118:in `compile'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-2.12.3/lib/rake/sprocketstask.rb:146:in `with_logger'
/usr/local/rvm/gems/ruby-2.2.0@ch_master_package/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
Aucun commentaire:
Enregistrer un commentaire