-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Describe the bug
Attempting to run bundle exec rake assets:precompile raises an exception
Reproduction steps
Update gem in a project using :sprockets, attempt to precompile
Expected behavior
Assets to be compiled as before
Additional context
railsversion:6.0.5rails_adminversion:3.0.0.betarails_adminnpm package version: N/A- full stack trace (if there's an exception)
(reduced this down to the essential bit of the error as we have internal middlewares in addition to those from Rails)
FrozenError:
can't modify frozen Array: [... middleware classes ]
/project_dir/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.5/lib/action_dispatch/middleware/stack.rb:126:in `push'
/project_dir/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.5/lib/action_dispatch/middleware/stack.rb:126:in `use'
/project_dir/vendor/bundle/ruby/2.7.0/gems/<internal gem>:in `block in <class:Engine>'
/project_dir/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/initializable.rb:32:in `instance_exec'
/project_dir/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/initializable.rb:32:in `run'
/project_dir/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/initializable.rb:61:in `block in run_initializers'
/project_dir/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/initializable.rb:60:in `run_initializers'
/project_dir/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/application.rb:363:in `initialize!'
This appears to be related to changes to initialization from e59a935
Workaround
Keep only the precompile initializer during precompilation
# application.rb
if ENV.fetch('PRECOMPILE', false)
RailsAdmin::Engine.initializers.keep_if { |i| i.name == 'RailsAdmin precompile hook' }
end
Metadata
Metadata
Assignees
Labels
No labels