I updated my app to Rails 7 and moved it from webpacker to shakapacker.
It is mostly a react frontend, with some old pages in haml with jquery listening on js files in app/assets.
Shakapacker and react front end is working properly, the rails views load (they don't even need webpacker running), but the jquery listeners are not running/listening to the rails views.
app/assets/javascripts/application.js
Is loading up, I can see through logging to the console.
The file looks like this:
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
// vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
console.log('Hello World from Webpacker 2')
// = require jquery-3.3.1.min
//= require popper
//= require rails-ujs
//= require cable
//= require jquery-ui
//= require activestorage
//= require bootstrap
//= require bootstrap-select
//= require moment
//= require tempusdominus-bootstrap-4
//= require jquery.easy-autocomplete.min
//= require jquery.slimscroll.min
//= require patch_modal
//= require_tree
React app is loaded up when rails routes using the react frontend are hit with: <%= javascript_pack_tag 'react_app', crossorigin: "anonymous" %> <%= stylesheet_pack_tag 'react_app', crossorigin: "anonymous" %>
Is there something else I need to configure to get my js files in app/assets/javascripts/*.js to compile with shakapacker?
I felt like it just worked with webpacker, I also tried a few other compilers (jsbuild, vite) and it was fine as well. I had to stop with them for other issues on my React side.
Any advice or pointers are super appreciated. I feel like I have spent way too long on making Rails 7 happy with the front end.
Thanks!!