Activity
@bemsa, I ran into the same issue and after going through a couple of articles online I was able to get it fixed.
If you are using esbuild do the following:
- make sure gem
jsbundling-rails
gem is in your Gemfile - run
bundle
- run
rails javascript:install:esbuild
- Take note of the last instruction which says you should copy the script ... and paste it in your package.json file
Your package.json file will look like this after pasting the script object
{ "name": "app", "private": true, "dependencies": { "@hotwired/stimulus": "^3.2.2", "@hotwired/turbo-rails": "^8.0.4", "esbuild": "^0.20.2" }, "scripts": { "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets" }, "version": "v1.22.19" }
- run bin/dev, this command will run esbuild and save your js assets in the /assets/builds/ directory , it also starts your webserver.
Hope this helps.