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

Setup & Quick Start guide from scratch results in showstopping error #153

Closed
bbugh opened this issue Apr 16, 2020 · 1 comment
Closed

Setup & Quick Start guide from scratch results in showstopping error #153

bbugh opened this issue Apr 16, 2020 · 1 comment

Comments

@bbugh
Copy link

bbugh commented Apr 16, 2020

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.

# 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).

Expected behavior

There's no error and it loads fine.

Versions

StimulusReflex

  • Gem: 3.1.0
  • Node package: 3.1.0

External tools

  • Ruby: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin18]
  • Rails: 6.0.2.2
  • Node: v10.15.3

Browser

  • Browser: Firefox 74.0.1
  • Browser: Chrome 79.0.3945.130
@bbugh
Copy link
Author

bbugh commented Apr 16, 2020

This looks like it is probably a duplicate of #151 given that it is the same error.

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

No branches or pull requests

1 participant