Enow B. Mbi

Joined

10 Experience
0 Lessons Completed
0 Questions Solved

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:

  1. make sure gem jsbundling-rails gem is in your Gemfile
  2. run bundle
  3. run rails javascript:install:esbuild
  4. 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" }
  5. 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.