BetterErrors / better_errors

Better error page for Rack apps
MIT License
6.88k stars 436 forks source link

Release 2.10.0 requires sassc as dependency #516

Closed bb closed 1 year ago

bb commented 1 year ago

I just tried to upgrade from 2.9.1 to 2.10.0 in a Rails project which is not using sassc itself.

The new version depends on sassc and is using it in better_errors-2.10.0/lib/better_errors/error_page_style.rb:1 without actually depending on it in the Gemfile.

This results in an Error when trying to run console or server:

<internal:/Users/bb/.rvm/rubies/ruby-3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- sassc (LoadError)
    from <internal:/Users/bb/.rvm/rubies/ruby-3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
    from /Users/bb/.rvm/gems/ruby-3.2.2/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
    from /Users/bb/.rvm/gems/ruby-3.2.2/gems/better_errors-2.10.0/lib/better_errors/error_page_style.rb:1:in `<main>'
...

Alternatively (and for me preferably), maybe the sass files could be compiled into the published Gem?

clairity commented 1 year ago

i just ran into this same error, on ruby 3.2.2 / rails 7.1.0.alpha with sprockets but no pre-processing of css/js assets (so no sass).

andyjeffries commented 1 year ago

Bit me too. Using Rails 7 with esbuild/tailwindcss (so no need for SASS in this project at all)

rnestler commented 1 year ago

Looking at https://github.com/BetterErrors/better_errors/pull/498/files it looks like the original plan was indeed to bundle the compiled css:

When the gem is built (in CI), main.css is built with the compressed CSS and included in the gem. The scss files are not included in the gem.

So the ErrorPageStyle module should probably just be split into the runtime part (which doesn't depend on scss) and the development part which does.

jrmhaig commented 1 year ago

Can you please clarify whether it is necessary for projects using better_errors to also include sassc as a development dependency explicitly or will there be a new version that resolves this?

thomasdarde commented 1 year ago

Hi , any update on this ?

mattbrictson commented 1 year ago

Looks like this issue can be closed. It has been fixed by #520 in better_errors 2.10.1.

bb commented 1 year ago

Thank you @RobinDaugherty and @jackjennings!