sstephenson / sprockets

Rack-based asset packaging system
2.55k stars 24 forks source link

Debugging suggestion #718

Closed djvs closed 8 years ago

djvs commented 9 years ago

Noticing in:

https://github.com/sstephenson/sprockets/blob/master/lib/sprockets/processed_asset.rb

in "initialize", it only tells you when an asset is done compiling, not when it is starting compilation. Maybe you could write both? At the moment, I am trying to debug this error:

NoMethodError: undefined method `bytesize' for nil:NilClass
[...] ruby-2.2.0/gems/rack-1.6.0/lib/rack/utils.rb:361:in `bytesize'
[...] ruby-2.2.0/gems/sprockets-2.12.3/lib/sprockets/processed_asset.rb:13:in `initialize'

which is proving extremely difficult without knowing what file is being precompiled. I often use "doing ..." and then "done" in my scripts, this is possible to do on the same line as well.

djvs commented 9 years ago

In the end the error turned out to be a corrupted (first line had Rails 3 syntax in a Rails 4 app) config/environments/production.rb.

Maybe, at bare minimum, you could do a begin/rescue/end block which catches the name of the failing asset that's compiling?

schneems commented 9 years ago

If this is still an active issue can you close this one and re-open it at http://github.com/rails/sprockets. Active development has moved to that repo.

If you've got a bug with sprockets 3 please make sure you've tried the latest 3.3.3. If you can confirm this is still an active issue, the fastest way to get it fixed is to create a small example app that reproduces the failure and open an issue in the new repo http://github.com/rails/sprockets.

rafaelfranca commented 8 years ago

This issue was moved to rails/sprockets#179