rails / coffee-rails

CoffeeScript adapter for the Rails asset pipeline. Also adds support for .coffee views.
MIT License
230 stars 64 forks source link

Execjs Errors Not Showing File Location #77

Open henggana opened 8 years ago

henggana commented 8 years ago

Hi, I did fresh install rails 4.2.5 with coffee-rails 4.1.0 and when there is syntax error on my .coffee file, the error only shows error message without the filename on which file the error happen.

SyntaxError: [stdin]:2:1: unexpected indentation

henggana commented 8 years ago

I got the same error with you @tonydefaria . Somehow, the file is missing from the gem. I suggest you open new issue for this.

kaspth commented 8 years ago

It was fixed minutes ago: https://github.com/rails/coffee-rails/commit/b3d64eb497db07346748a0504e353741b621bc23#diff-f84830974ae1c830a380311e98357d07R19

Please try 4.2.1 😁

kaspth commented 8 years ago

@henggana oh sorry, your original comment looks like it's referring to something else. I'd reopen but Rafael already did 😁

prathamesh-sonpatki commented 8 years ago

@henggana Can you upload a sample application on Github that reproduces the issue? Thanks.

raykin commented 7 years ago

got same error on custom precompile js on Rails4.2 and coffee-rails 4.2.1. The last ten lines of stack trace

ExecJS::RuntimeError - SyntaxError: [stdin]:57:21: unexpected ->:
  execjs (2.7.0) lib/execjs/external_runtime.rb:84:in `extract_result'
  execjs (2.7.0) lib/execjs/external_runtime.rb:39:in `exec'
  execjs (2.7.0) lib/execjs/external_runtime.rb:21:in `eval'
  execjs (2.7.0) lib/execjs/external_runtime.rb:46:in `call'
  coffee-script (2.4.1) lib/coffee_script.rb:78:in `compile'
  sprockets (3.7.1) lib/sprockets/coffee_script_processor.rb:21:in `block in call'
  sprockets (3.7.1) lib/sprockets/cache.rb:85:in `fetch'
  sprockets (3.7.1) lib/sprockets/coffee_script_processor.rb:20:in `call'
  sprockets (3.7.1) lib/sprockets/processor_utils.rb:75:in `call_processor'
  sprockets (3.7.1) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
  sprockets (3.7.1) lib/sprockets/processor_utils.rb:56:in `call_processors'
rgaufman commented 5 years ago

Same here, Rails 5.2.3, Coffee-Rails 5.0.0, getting this error:

     Failure/Error: asset_path(brand.logo)

     ActionView::Template::Error:
       SyntaxError: [stdin]:635:1: unexpected indentation
     # compile ((execjs):7528:19)
     # eval (eval at <anonymous> ((execjs):7539:8), <anonymous>:1:10)
     # (execjs):7539:8
     # (execjs):7545:14
     # (execjs):1:40
     # Object.<anonymous> ((execjs):1:58)
     # Module._compile (internal/modules/cjs/loader.js:776:30)
     # Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
     # Module.load (internal/modules/cjs/loader.js:643:32)
     # Function.Module._load (internal/modules/cjs/loader.js:556:12)
     # Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
     # internal/main/run_main_module.js:17:11
     # /usr/local/lib/ruby/gems/2.6.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:39:in `exec'

No idea what file or line :(

LissyTree commented 2 years ago

Hi, I'm having the same error, Rails 6.0.5, Coffee-Rails 5.0.0, using Node.js

ExecJS::RuntimeError: SyntaxError: [stdin]:26:1: unexpected indentation compile ((execjs):7528:19) eval (eval at ((execjs):7539:8), :1:10) (execjs):7539:8 (execjs):7557:14 (execjs):1:40 Object. ((execjs):1:58) Module._compile (node:internal/modules/cjs/loader:1105:14) Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) Module.load (node:internal/modules/cjs/loader:981:32) Function.Module._load (node:internal/modules/cjs/loader:822:12) Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) node:internal/main/run_main_module:17:47 /Users/development/.rvm/gems/ruby-2.6.9/gems/execjs-2.8.1/lib/execjs/external_runtime.rb:39:in `exec'

This error occurred after updating from Rails 5.2 to Rails 6.0. Is there any solution or hint to fix this?

pgiblock commented 1 month ago

Still an issue 8 years later...