view_component_reflex: Broadcasting Error in production
In development the gem is working great, the other Stimulus Reflex stuff is working aswell in production - but If I try to use View Component Reflex in production I get the following error:
StimulusReflex::Channel#receive({"target"=>"PerformedOrdersComponent#get_orders", "args"=>[], "url"=>"https://webmenue.nkbrf.de/users/9/show_orders", "attrs"=>{"id"=>"date_month", "name"=>"date[month]", "class"=>"form-control shadow font-weight-bold", "data-reflex"=>"change->PerformedOrdersComponent#get_orders", "data-user-id"=>"9", "data-key"=>"4002470145471996799", "data-controller"=>"stimulus-reflex", "data-action"=>"change->stimulus-reflex#__perform", "checked"=>false, "selected"=>false, "tag_name"=>"SELECT", "values"=>["6"], "value"=>"6"}, "dataset"=>{"data-reflex"=>"change->PerformedOrdersComponent#get_orders", "data-user-id"=>"9", "data-key"=>"4002470145471996799", "data-controller"=>"stimulus-reflex", "data-action"=>"change->stimulus-reflex#__perform"}, "selectors"=>[], "reflexId"=>"9474f0a5-f262-499a-bbd7-88defe71f477", "permanent_attribute_name"=>"data-reflex-permanent", "params"=>{}})
Could not execute command from ({"command"=>"message", "identifier"=>"{\"channel\":\"StimulusReflex::Channel\"}", "data"=>"{\"target\":\"PerformedOrdersComponent#get_orders\",\"args\":[],\"url\":\"https://webmenue.nkbrf.de/users/9/show_orders\",\"attrs\":{\"id\":\"date_month\",\"name\":\"date[month]\",\"class\":\"form-control shadow font-weight-bold\",\"data-reflex\":\"change->PerformedOrdersComponent#get_orders\",\"data-user-id\":\"9\",\"data-key\":\"4002470145471996799\",\"data-controller\":\"stimulus-reflex\",\"data-action\":\"change->stimulus-reflex#__perform\",\"checked\":false,\"selected\":false,\"tag_name\":\"SELECT\",\"values\":[\"6\"],\"value\":\"6\"},\"dataset\":{\"data-reflex\":\"change->PerformedOrdersComponent#get_orders\",\"data-user-id\":\"9\",\"data-key\":\"4002470145471996799\",\"data-controller\":\"stimulus-reflex\",\"data-action\":\"change->stimulus-reflex#__perform\"},\"selectors\":[],\"reflexId\":\"9474f0a5-f262-499a-bbd7-88defe71f477\",\"permanent_attribute_name\":\"data-reflex-permanent\",\"params\":{}}"}) [NoMethodError - undefined method
broadcast_message’ for nil:NilClass]: /home/deploy/webmenue/shared/bundle/ruby/2.6.0/gems/stimulus_reflex-3.3.0.pre2/lib/stimulus_reflex/channel.rb:37:in rescue in receive' | /home/deploy/webmenue/shared/bundle/ruby/2.6.0/gems/stimulus_reflex-3.3.0.pre2/lib/stimulus_reflex/channel.rb:30:in
receive’ | /home/deploy/webmenue/shared/bundle/ruby/2.6.0/gems/actioncable-6.0.3.2/lib/action_cable/channel/base.rb:268:in public_send' | /home/deploy/webmenue/shared/bundle/ruby/2.6.0/gems/actioncable-6.0.3.2/lib/action_cable/channel/base.rb:268:in
dispatch_action’ | /home/deploy/webmenue/shared/bundle/ruby/2.6.0/gems/actioncable-6.0.3.2/lib/action_cable/channel/base.rb:170:in block in perform_action'
The channel is working normally:
StimulusReflex::Channel is streaming from StimulusReflex::Channel:9
It’s just happening in production, any idea?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (11 by maintainers)
I went ahead and published that change
I’ll try changing everything to their full module paths after work
No, if it works in development, it should work in production.
I wonder if there’s some autoloading bug going on. The reflexes are created at runtime (the first time component_controller is called actually), so there’s no reason it that error could happen, especially since the expo site doesn’t have this problem.
I’ll try using the code samples you provided to re-create it after work