Found the following instructions that got me to the point where esbuild replaced import maps and bootstrap was installed.
https://mixandgo.com/learn/ruby-on-rails/how-to-install-bootstrap
You will find that even after fixing the Javascript issues Javascript still does not work. When looking in the log files I saw there were issues with trix loading as well as issues with importing stimulus controllers.
What I ended up doing was modifying package.json
and add the following:
"@rails/actiontext": "^7.0.4",
"trix": "^2.0.4"
I then modified app/assets/stylesheets/application.bootstrap.scss
and added the following line:
@import 'actiontext.css';
Finally, I ran ./bin/rails stimulus:manifest:update
in terminal to update app/javascript/controllers/index.js
to register all of the stimulus controllers I had created.
You should then be able to run bin/dev
and (hopefully) shouldn't see any errors.
I was able to quickly install a boostrap nav bar and make sure that the dropdown worked indicating the Javascript was functioning.
I then checked any place I implemented action text functioned ok as well as any places where I implemented a stimulus controller to make sure those were working.
If in the event, you still have errors popping up, the way I figured things out was to generate a new rails app with action text to see how the code was generated:
rails new trixtest -j esbuild --css bootstrap
bin/rails action_text:install
I would start by comparing the following between the new app and your existing app
- package.json
- app/javascript/application.js
- app/assets/config/manifest.js
- app/javascript/controllers/index.js