Following the "Setup" and "Quick Start" guide process exactly results in breaking socket is undefined error in the JS console in Firefox, andUncaught TypeError: Cannot read property 'removeEventListener' of undefined` in Chrome (both raised by same line of code).
It looks like StimulusReflex is looking for something on the ActionCable JS object that doesn't exist. Is this because of #132 maybe? Or is there another dependency or import missing from the instructions?
To Reproduce
Following the setup guide exactly and then using the sample code results in socket is undefined in the JavaScript console.
# these are the setup instructions
rails new myproject --webpack=stimulus # Rails 6.0.2.2
cd myproject
bundle add stimulus_reflex
bundle exec rails stimulus_reflex:install
# make a controller
bin/rails g controller pages index
Add the sample code from the quickstart guide to the pages/index.html.erb.
bin/webpack-dev-server
bin/rails s
Finally, load localhost:3000/pages/index and observe that the JavaScript console says socket is undefined in Firefox (or the Chrome error).
Bug Report
Describe the bug
Following the "Setup" and "Quick Start" guide process exactly results in breaking
socket is undefined error in the JS console in Firefox, and
Uncaught TypeError: Cannot read property 'removeEventListener' of undefined` in Chrome (both raised by same line of code).It looks like StimulusReflex is looking for something on the ActionCable JS object that doesn't exist. Is this because of #132 maybe? Or is there another dependency or import missing from the instructions?
To Reproduce
Following the setup guide exactly and then using the sample code results in
socket is undefined
in the JavaScript console.Add the sample code from the quickstart guide to the
pages/index.html.erb
.Finally, load
localhost:3000/pages/index
and observe that the JavaScript console sayssocket is undefined
in Firefox (or the Chrome error).Expected behavior
There's no error and it loads fine.
Versions
StimulusReflex
External tools
Browser