Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I debug sprockets-rails? #447

Open
JohnSmall opened this issue Oct 15, 2019 · 0 comments
Open

How do I debug sprockets-rails? #447

JohnSmall opened this issue Oct 15, 2019 · 0 comments

Comments

@JohnSmall
Copy link

Context. Ruby ruby-2.5.5, Rails 5.2.3, Sprockets 3.7.2, Sprockets-rails 3.2.1
Running a project with lots and lots of css and js assets.

Problem: When running with config.assets.debug = true I can load all the assets as the dependencies all load individually.

When I pre-compile assets so that they're in public/assets then I can run with config.assets.debug = false. But with config.assets.debug = false and no pre-compiled assets then it fails. The error from curl is

  * transfer closed with 832716 bytes remaining to read
  * stopped the pause stream!
  * Closing connection 0
  curl: (18) transfer closed with 832716 bytes remaining to read

And similar error in Chrome console.

But it does send back the size of the concatenated assets in the header. And then fails when it doesn't get that number of bytes. So somewhere in the code it's already got all the files together so it knows how many bytes it's going to send back.

I'm guessing that it might be because it tries to compile all the assets on first request, and because they're so big (it's not me, I'm taking over this project), it times out before it finishes. I've tried extending the wait time in Puma and Curl but it doesn't work.

I did find that if there are no dependencies in application.css.scss or if the dependencies have nothing in them then it'll return quickly. Any css in application.css.scss will be returned.

To debug this I need to checkout the gem and put some byebug statements in the code. But where would I start? I need to see what it's trying to return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant