-
Notifications
You must be signed in to change notification settings - Fork 105
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
Error in production mode on RoR 7.0.3.1 with Bootstrap 5.2 #174
Comments
I'm seeing this too on a build I'm trying to deploy to Heroku. Or at least, a variation of it. |
If anyone has a workaround for this, please let me know! At the moment I don't see a clear way forward. I've spent some time today trying to narrow this down, and I hope that someone will read this testcase and might recognise the problem. The full input line from bootstrap 5.2 is require 'sassc'
# An empty url() is fine
data = '.foo { --bar:url() }'
puts SassC::Engine.new(data).render
# A non-empty url() wrapped in interpolation is fine
data = '.foo { --bar:#{url("foo")} }'
puts SassC::Engine.new(data).render
# A non-empty url() with a space beforehand is fine
data = '.foo { --bar: url("foo") }'
puts SassC::Engine.new(data).render
# A non-empty url with no space works for non-custom properties
data = '.foo { bar:url("foo") }'
puts SassC::Engine.new(data).render
# A non-empty url with no space throws an error
data = '.foo { --bar:url("foo") }'
puts SassC::Engine.new(data).render output:
If anyone recognises this, and can post a link to an issue in sassc-ruby or libsass, that would be useful! Or any workarounds gratefully received. |
This worked for me: sass/sassc-ruby#233 |
FYI I'm maintaining dartsass-sprockets which is a fork of this gem based on the code which @Firefishy posted. Please try it and see if it works. |
@johnnyshields thanks for your work on dartsass-sprockets! I would happily switch to it, but unfortunately the bootstrap rubygem has a runtime dependency on sassc-rails, and dragging that in leads to namespace conflicts between sassc-rails and dartsass-sprockets. See also twbs/bootstrap-rubygem#255 |
I managed to figure out some of the root cause, along with a partial workaround. Based on my initial work, it's only a problem when the space between the In our case, this is because we had a This also explains why it worked fine for me in development, and not in testing/production, since development doesn't compress any of the SCSS files. The true fix would be to isolate the parsing bug and patch libsass, but I'm not intending to attempt that (and libsass is deprecated anyway, so the effort might be futile). The workaround is to make sure that you a) have your main stylesheet as a I hope this helps someone else too, it took me a while to figure out! |
There are two options for combining stylesheets, using sprockets (via `require` statements) or using sass (via `@import` statements. This commit switches to using `@import` statements throughout, to avoid a bug with libsass that prevents us from using bootstrap 5.2+ See sass/sassc-rails#174 Since R2 is not triggered when `@import`ing a file, we need to switch the top-level stylesheet names to include the extension. We can also take the opportunity to remove a level of indirection, along with removing symlinks which cause problems on some platforms. * openstreetmap#3984 * openstreetmap#3422
There are two options for combining stylesheets, using sprockets (via `require` statements) or using sass (via `@import` statements). This commit switches to using `@import` statements throughout, to avoid a bug with libsass that prevents us from using bootstrap 5.2+ See sass/sassc-rails#174 Since R2 is not triggered when `@import`ing a file, we need to switch the top-level stylesheet names to include the extension. We can also take the opportunity to remove a level of indirection, along with removing symlinks which cause problems on some platforms. * openstreetmap#3984 * openstreetmap#3422
Ruby 3.1.2
Ruby on Rails 7.0.3.1
Third party library: Bootstrap 5.2 ( new version 5.2 released )
With bootstrap 5.1.3 (previous version) all works fine!
app/assets/config/manifest.js
:in view stylesheets and javascripts are attached via
stylesheet_link_tag
andjavascript_include_tag
config/environments/production.rb
:log/production.log
:The text was updated successfully, but these errors were encountered: