You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add <div data-controller="hello"></div> to anywhere
run rails s
Notice that the Stimulus controller works fine:
Now install cssbundling the following way:
add gem 'cssbundling-rails' and uncomment gem 'sassc-rials'
bundle install
now run the cssbundling installer with rails css:install:bootstrap
You will now have the new bin/dev rails command on your machine (it is not there before you installed cssbundling). Whether rails is started with rails s or bin/dev rails, I get the same result, the Stimulus controller dies:
There's also a strange console error, which I oddly I can't CLICK ON to see the line number. not sure why I can't click on it, usually Chrome lets me click into the line number where the error is and shows me the calling code, but in this error when I click it just does nothing.
I'm not sure if the problem here is that cssbundling must be used with jsbundling and/or if jsbundling is used in conjunction with or as a replacement to importmap. I've spoken to several people on the chat boards and slack channel who are also confused by this so I would strongly urge some clarity around this.
I will re-attempt now with both cssbundling and jsbundling (this ticket is specific to ONLY cssbundling on top of rails new) At the very least if this is the wrong strategy I would strongly recommend documenting it clearly because right now I would still put this in the no-happiness category.
The text was updated successfully, but these errors were encountered:
jasonfb
changed the title
Installing css-bundling on top of a new rails app breaks Stimulus, as well, some strange error in browser console
Installing cssbundling-rails on top of a new rails app breaks Stimulus, as well, some strange error in browser console
Jan 28, 2022
rails new TestApp
rails generate scaffold Posts
rails db:migrate
add
<div data-controller="hello"></div>
to anywhererun
rails s
Notice that the Stimulus controller works fine:
Now install cssbundling the following way:
add
gem 'cssbundling-rails'
and uncommentgem 'sassc-rials'
bundle install
now run the cssbundling installer with
rails css:install:bootstrap
You will now have the new
bin/dev rails
command on your machine (it is not there before you installed cssbundling). Whether rails is started withrails s
orbin/dev rails
, I get the same result, the Stimulus controller dies:There's also a strange console error, which I oddly I can't CLICK ON to see the line number. not sure why I can't click on it, usually Chrome lets me click into the line number where the error is and shows me the calling code, but in this error when I click it just does nothing.
I'm not sure if the problem here is that
cssbundling
must be used withjsbundling
and/or ifjsbundling
is used in conjunction with or as a replacement to importmap. I've spoken to several people on the chat boards and slack channel who are also confused by this so I would strongly urge some clarity around this.I will re-attempt now with both
cssbundling
andjsbundling
(this ticket is specific to ONLY cssbundling on top ofrails new
) At the very least if this is the wrong strategy I would strongly recommend documenting it clearly because right now I would still put this in the no-happiness category.The text was updated successfully, but these errors were encountered: