Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to push to Heroku after being able to do do

I am unable to push to Heroku. When I attempt to I get an ExecJS::ProgramError: of some kind or another. I have had multiple people check my code and no one can seem to figure it out. It appears that I have something saved wrong possibly.

When I do git push heroku master I get the following when it tries to precompile the assets:

    Running: rake assets:precompile
   rake aborted!
   ExecJS::ProgramError: Unexpected character '#' (line: 16164, col: 0, pos: 471385)
   Error
   at new JS_Parse_Error (/tmp/execjs20140502-719-9ngq7y.js:2357:10754)
   at js_error (/tmp/execjs20140502-719-9ngq7y.js:2357:10973)
   at parse_error (/tmp/execjs20140502-719-9ngq7y.js:2357:12691)
   at Object.next_token [as input] (/tmp/execjs20140502-719-9ngq7y.js:2357:17713)
   at next (/tmp/execjs20140502-719-9ngq7y.js:2357:19012)
   at semicolon (/tmp/execjs20140502-719-9ngq7y.js:2357:19857)
   at simple_statement (/tmp/execjs20140502-719-9ngq7y.js:2357:22669)
   at /tmp/execjs20140502-719-9ngq7y.js:2357:20820
   at /tmp/execjs20140502-719-9ngq7y.js:2357:20069
   at /tmp/execjs20140502-719-9ngq7y.js:2358:40
   (in /tmp/build_e82cf52d-86e5-45ea-83e9- 

9841d4de5c60/app/assets/javascripts/application.js)/tmp/build_e82cf52d-86e5-45ea-  
83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/execjs-
2.0.2/lib/execjs/external_runtime.rb:68:in `extract_result'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/execjs-2.0.2/lib/execjs/external_runtime.rb:28:in `block in exec'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/execjs-2.0.2/lib/execjs/external_runtime.rb:41:in `compile_to_tempfile'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/execjs-2.0.2/lib/execjs/external_runtime.rb:27:in `exec'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/uglifier-2.5.0/lib/uglifier.rb:186:in `really_compile'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/uglifier-2.5.0/lib/uglifier.rb:110:in `compile'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/uglifier_compressor.rb:25:in `evaluate'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:197:in `block in evaluate'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `each'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `evaluate'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/bundled_asset.rb:25:in `initialize'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in `new'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in `build_asset'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:94:in `block in build_asset'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58:in `cache_asset'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:93:in `build_asset'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:287:in `find_asset'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:61:in `find_asset'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:211:in `block in find_asset'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:257:in `benchmark'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:210:in `find_asset'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:119:in `block in compile'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in `each'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in `compile'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:60:in `block (3 levels) in define'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/rake/sprocketstask.rb:146:in `with_logger'
   /tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:59:in `block (2 levels) in define'
   Tasks: TOP => assets:precompile
   (See full trace by running task with --trace)
 !
 !         Precompiling assets failed.
 !

 !         Push rejected, failed to compile Ruby app

To [email protected]:dumb-law.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:dumb-law.git'
like image 416
Brad Avatar asked Dec 19 '22 15:12

Brad


1 Answers

I had the same problem and finally discovered the cause in the console output of the website, where it showed me an error of a js-file with illegal tokens. In my case, it was an empty, auto-generated coffeescript file, that I recklessly renamed into a js file, which doesn't use '#' for comments. The site still worked without problems but the precompilation did not. Removing the file solved my problem. Maybe you can find something similar in your js-console :)

like image 186
irruputuncu Avatar answered Jan 05 '23 22:01

irruputuncu