railsadminteam / rails_admin

RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data
MIT License
7.88k stars 2.25k forks source link

[beta version] Rails admin with webpack and css/js bundling still requires sassc gem. #3536

Closed estebanz01 closed 2 years ago

estebanz01 commented 2 years ago

Describe the bug When trying to access rails admin configured with jsbundling-rails (webpack) and cssbundling-rails (sass) it still requires sassc gem.

Reproduction steps With a configured rails admin, go to /admin.

Expected behavior It should try to load the rails admin engine as expected.

Additional context

zeitwerk (2.6.0) lib/zeitwerk/kernel.rb:35:in require' zeitwerk (2.6.0) lib/zeitwerk/kernel.rb:35:inrequire'
sprockets (4.1.1) lib/sprockets/autoload/sassc.rb:2:in <top (required)>' zeitwerk (2.6.0) lib/zeitwerk/kernel.rb:35:inrequire'
zeitwerk (2.6.0) lib/zeitwerk/kernel.rb:35:in require' sprockets (4.1.1) lib/sprockets/sassc_processor.rb:42:ininitialize' sprockets (4.1.1) lib/sprockets/sassc_processor.rb:27:in new' sprockets (4.1.1) lib/sprockets/sassc_processor.rb:27:ininstance' sprockets (4.1.1) lib/sprockets/sassc_processor.rb:31:in call' sprockets (4.1.1) lib/sprockets/processor_utils.rb:84:incall_processor' sprockets (4.1.1) lib/sprockets/processor_utils.rb:66:in block in call_processors' sprockets (4.1.1) lib/sprockets/processor_utils.rb:65:inreverse_each' sprockets (4.1.1) lib/sprockets/processor_utils.rb:65:in call_processors' sprockets (4.1.1) lib/sprockets/processor_utils.rb:22:inblock in ' sprockets (4.1.1) lib/sprockets/processor_utils.rb:33:in call' sprockets (4.1.1) lib/sprockets/processor_utils.rb:84:incall_processor' sprockets (4.1.1) lib/sprockets/processor_utils.rb:66:in block in call_processors' sprockets (4.1.1) lib/sprockets/processor_utils.rb:65:inreverse_each' sprockets (4.1.1) lib/sprockets/processor_utils.rb:65:in call_processors' sprockets (4.1.1) lib/sprockets/loader.rb:182:inload_from_unloaded' sprockets (4.1.1) lib/sprockets/loader.rb:59:in block in load' sprockets (4.1.1) lib/sprockets/loader.rb:337:infetch_asset_from_dependency_cache' sprockets (4.1.1) lib/sprockets/loader.rb:43:in load' sprockets (4.1.1) lib/sprockets/cached_environment.rb:44:inblock in load' sprockets (4.1.1) lib/sprockets/cached_environment.rb:44:in fetch' sprockets (4.1.1) lib/sprockets/cached_environment.rb:44:inload' sprockets (4.1.1) lib/sprockets/bundle.rb:27:in call' sprockets (4.1.1) lib/sprockets/processor_utils.rb:84:incall_processor' sprockets (4.1.1) lib/sprockets/processor_utils.rb:66:in block in call_processors' sprockets (4.1.1) lib/sprockets/processor_utils.rb:65:inreverse_each' sprockets (4.1.1) lib/sprockets/processor_utils.rb:65:in call_processors' sprockets (4.1.1) lib/sprockets/loader.rb:182:inload_from_unloaded' sprockets (4.1.1) lib/sprockets/loader.rb:59:in block in load' sprockets (4.1.1) lib/sprockets/loader.rb:337:infetch_asset_from_dependency_cache' sprockets (4.1.1) lib/sprockets/loader.rb:43:in load' sprockets (4.1.1) lib/sprockets/cached_environment.rb:44:inblock in load' sprockets (4.1.1) lib/sprockets/cached_environment.rb:44:in fetch' sprockets (4.1.1) lib/sprockets/cached_environment.rb:44:inload' sprockets (4.1.1) lib/sprockets/base.rb:81:in find_asset' sprockets (4.1.1) lib/sprockets/base.rb:119:in[]' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:358:in find_asset' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:337:indigest_path' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:326:in asset_path' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:103:inblock in resolve_asset_path' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:243:in block in resolve_asset' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:242:ineach' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:242:in detect' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:242:inresolve_asset' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:102:in resolve_asset_path' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:80:incompute_asset_path' actionview (7.0.3) lib/action_view/helpers/asset_url_helper.rb:203:in asset_path' actionview (7.0.3) lib/action_view/helpers/asset_url_helper.rb:348:instylesheet_path' actionview (7.0.3) lib/action_view/helpers/asset_tag_helper.rb:180:in block in stylesheet_link_tag' actionview (7.0.3) lib/action_view/helpers/asset_tag_helper.rb:179:inmap' actionview (7.0.3) lib/action_view/helpers/asset_tag_helper.rb:179:in stylesheet_link_tag' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:186:inblock in stylesheet_link_tag' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:184:in map' sprockets-rails (3.4.2) lib/sprockets/rails/helper.rb:184:instylesheet_link_tag' rails_admin (3.1.0.beta) app/views/layouts/rails_admin/_head.html.erb:16 actionview (7.0.3) lib/action_view/base.rb:244:in public_send' actionview (7.0.3) lib/action_view/base.rb:244:in_run' actionview (7.0.3) lib/action_view/template.rb:157:in block in render' activesupport (7.0.3) lib/active_support/notifications.rb:206:inblock in instrument' activesupport (7.0.3) lib/active_support/notifications/instrumenter.rb:24:in instrument' activesupport (7.0.3) lib/active_support/notifications.rb:206:ininstrument' actionview (7.0.3) lib/action_view/template.rb:361:in instrument_render_template' actionview (7.0.3) lib/action_view/template.rb:155:inrender' actionview (7.0.3) lib/action_view/renderer/partial_renderer.rb:251:in block in render_partial_template' activesupport (7.0.3) lib/active_support/notifications.rb:206:inblock in instrument' activesupport (7.0.3) lib/active_support/notifications/instrumenter.rb:24:in instrument' activesupport (7.0.3) lib/active_support/notifications.rb:206:ininstrument' actionview (7.0.3) lib/action_view/renderer/partial_renderer.rb:246:in render_partial_template' actionview (7.0.3) lib/action_view/renderer/partial_renderer.rb:237:inrender' actionview (7.0.3) lib/action_view/renderer/renderer.rb:81:in render_partial_to_object' actionview (7.0.3) lib/action_view/renderer/renderer.rb:53:inrender_partial' actionview (7.0.3) lib/action_view/helpers/rendering_helper.rb:44:in render' rails_admin (3.1.0.beta) app/views/layouts/rails_admin/application.html.erb:4 actionview (7.0.3) lib/action_view/base.rb:244:inpublic_send' actionview (7.0.3) lib/action_view/base.rb:244:in _run' actionview (7.0.3) lib/action_view/template.rb:157:inblock in render' activesupport (7.0.3) lib/active_support/notifications.rb:206:in block in instrument' activesupport (7.0.3) lib/active_support/notifications/instrumenter.rb:24:ininstrument' activesupport (7.0.3) lib/active_support/notifications.rb:206:in instrument' actionview (7.0.3) lib/action_view/template.rb:361:ininstrument_render_template' actionview (7.0.3) lib/action_view/template.rb:155:in render' actionview (7.0.3) lib/action_view/renderer/template_renderer.rb:76:inblock in render_with_layout' activesupport (7.0.3) lib/active_support/notifications.rb:206:in block in instrument' activesupport (7.0.3) lib/active_support/notifications/instrumenter.rb:24:ininstrument' activesupport (7.0.3) lib/active_support/notifications.rb:206:in instrument' actionview (7.0.3) lib/action_view/renderer/template_renderer.rb:74:inrender_with_layout' actionview (7.0.3) lib/action_view/renderer/template_renderer.rb:59:in render_template' actionview (7.0.3) lib/action_view/renderer/template_renderer.rb:11:inrender' actionview (7.0.3) lib/action_view/renderer/renderer.rb:61:in render_template_to_object' actionview (7.0.3) lib/action_view/renderer/renderer.rb:29:inrender_to_object' actionview (7.0.3) lib/action_view/rendering.rb:117:in block in _render_template' actionview (7.0.3) lib/action_view/base.rb:270:inin_rendering_context'

 etc...

estebanz01 commented 2 years ago

I'm handling all the compilation via webpack, so that's why I reported this, btw 😀 .

mshibuya commented 2 years ago

Could you check if you have rails_admin.scss somewhere in your asset path? If no, I want to know what file triggered that loading of sassc. That'll be possible by attaching a debugger around here and inspecting the value of input[:filename], I guess... https://github.com/rails/sprockets/blob/v4.1.1/lib/sprockets/sassc_processor.rb#L31

estebanz01 commented 2 years ago

I tried to reproduce this error without luck so I'm going to close it (frustrating too much? 🙃 ).

I had issues with my dev machine so I lost my testing repo, when trying to replicate it rom scratch, I couldn't trigger this. Thanks anyway.

fzf commented 9 months ago

@mshibuya I do have rails_admin.scss in my assets/stylesheets path and I am encountering the same issue. Is there anything that I can do to fix it?

mshibuya commented 9 months ago

How do you build RailsAdmin assets? What's the value of config.asset_source ?

fzf commented 9 months ago

@mshibuya I was able to fix it by adding gem "sassc-rails" and running yarn build:css manually. Thanks for your prompt help!