Skip to content
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

undefined method for options[:sprockets][:context] #721

Open
leoplct opened this issue Oct 15, 2021 · 1 comment
Open

undefined method for options[:sprockets][:context] #721

leoplct opened this issue Oct 15, 2021 · 1 comment

Comments

@leoplct
Copy link

leoplct commented Oct 15, 2021

Expected behavior

RAILS_ENV=production rake assets:precompile --trace

Actual behavior

Raise undefined method at this line

[GEM_ROOT]/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:278:in `sprockets_context'

def sprockets_context
    options[:sprockets][:context] <---- ERROR HERE
end
NoMethodError: undefined method `[]' for nil:NilClass
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:278:in `sprockets_context'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:124:in `asset_path'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:137:in `asset_url'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/script/tree/funcall.rb:151:in `block in _perform'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/stack.rb:108:in `block in with_function'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/stack.rb:135:in `with_frame'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/stack.rb:108:in `with_function'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/script/tree/funcall.rb:149:in `_perform'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/script/tree/node.rb:50:in `perform'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:398:in `visit_prop'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:36:in `visit'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/stack.rb:79:in `block in with_base'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/stack.rb:135:in `with_frame'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/stack.rb:79:in `with_base'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:158:in `visit'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:513:in `block (2 levels) in visit_directive'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:513:in `map'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:513:in `block in visit_directive'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:179:in `with_environment'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:512:in `visit_directive'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:36:in `visit'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/stack.rb:79:in `block in with_base'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/stack.rb:135:in `with_frame'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/stack.rb:79:in `with_base'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:158:in `visit'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:52:in `map'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:52:in `visit_children'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:167:in `block in visit_children'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:179:in `with_environment'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:166:in `visit_children'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:36:in `block in visit'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:186:in `visit_root'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:36:in `visit'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:157:in `visit'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:10:in `visit'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/root_node.rb:36:in `css_tree'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/tree/root_node.rb:20:in `render'
/.rvm/gems/ruby-3.0.2/gems/sass-3.7.4/lib/sass/engine.rb:290:in `render'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/sass_compressor.rb:48:in `call'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/sass_compressor.rb:28:in `call'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/loader.rb:60:in `block in load'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:142:in `block in find'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `each'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `stat_directory'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:227:in `stat_tree'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `each'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `each'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `logical_paths'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:140:in `find'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile'
/.rvm/gems/ruby-3.0.2/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define'
/.rvm/gems/ruby-3.0.2/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger'
/.rvm/gems/ruby-3.0.2/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/.rvm/gems/ruby-3.0.2/gems/sentry-ruby-core-4.7.3/lib/sentry/rake.rb:23:in `block in execute'
/.rvm/gems/ruby-3.0.2/gems/sentry-ruby-core-4.7.3/lib/sentry/hub.rb:158:in `with_background_worker_disabled'
/.rvm/gems/ruby-3.0.2/gems/sentry-ruby-core-4.7.3/lib/sentry/rake.rb:22:in `execute'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/.rvm/gems/ruby-3.0.2/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/.rvm/gems/ruby-3.0.2/bin/rake:23:in `load'
/.rvm/gems/ruby-3.0.2/bin/rake:23:in `<main>'

Tasks: TOP => assets:precompile

System configuration

  • Sprockets version 3.7.2
  • Ruby version 3.0.2

GEMFILE

gem 'sass-rails', '~> 5.0'
gem 'jsbundling-rails'
gem 'cssbundling-rails'
gem 'hotwire-rails'

It doesn't come from my app folder, so I don't know where I could look at.

@rafaelfranca
Copy link
Member

Can you provide an example application that reproduce the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants