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
Simultaenous use of manifest and a magic comment #7455
Comments
If I can understant correctly, Correct? |
That seems like it might be the issue, yes. I forget exactly how all this works, to be honest, but that sounds about right. |
Well, we can add a simple conditional in sprockets code for magic comment. It would check is first line is a magic comment specifying the encoding, if yes then would scan rest of the file for any Let me know if this is the correct approach to fix or there is a better way. I will try to write patch over the weekend :) |
Discussing this with @tenderlove, apparently there are bugs in |
Why are you including the magic comment, by the way? Rails should serve everything with a utf8 encoding by default. |
Since Rails has the 'use whatever Javascript runtime' code in it, you may get intermittent failures due to environmental differences :/ |
Later in this fils is a 'render' of a file with some special symbols. Until I have the magic comment, it gives me an error of incompatibility with ASCII. |
Ahh, yes, processing in plain ruby outside of Rails would make this happen. Just wondering; obviously, that should work somehow. |
Is this really a Rails issue or a Sprockets issue? Is it still relevant? |
The last time I checked the problem was still here. |
It's part of Rails for 3.2, it's part of sprockets-rails for Rails 4. |
Very good. Looking forward for the Rails 4 release. |
I've got the same problem. One workaround is to run ruby with -Ku to avoid needing the magic comment at all. |
Ruby 2.0 has UTF-8 default encoding, which may make magic comments omissible & fix this issue. |
@gaurish except that while Rails supports 1.9.3 that isn't an acceptable fix ;) has anyone made any progress on this? [triage] |
I used something like this temporarily: tgaff/sprockets@a098b35 |
This issue has been automatically marked as stale because it has not been commented on for at least The resources of the Rails team are limited, and so we are asking for your help. If you can still reproduce this error on the Thank you for all your contributions. |
This issue has been automatically closed because of inactivity. If you can still reproduce this error on the Thank you for all your contributions. |
Rails 3.2.8.
I've got a .js.erb file where I need to use both manifest and a magic comment, and I would assume that this should work:
or at least this should work:
as erb processing has to be done before js processing resulting in js getting simple
But for some strange reason manifest directives don't work and are just included as text. Putting manifest definitions the first and encoding the second enables manifest but disables encoding.
The text was updated successfully, but these errors were encountered: