I’m trying to get back into rails development and recently started a project that I initiated with importmaps for managing javascript libraries. However I can’t seem to pin certain libraries and decided to migrate to asset pipeline. Through trial and error I made it work (by comparing my project with new project that was initiated with jsbundling-rails), however I feel that I have misconfiguration issues.
Whenever I change the code in a stimulus controller I have to clobber and precompile assets, because the change is not picked up in the browser. What can be wrong here? I’m also using the hotwire-livereload gem, however the result is the same with or without having livereload enabled in application’s layout.
I have a /bin/dev server with following Procfile.dev
web: unset PORT && env RUBY_DEBUG_OPEN=true bin/rails server
js: yarn build --watch
css: yarn build:css --watch
I can also see the logs when I save js, html or css file that rebuild is happening. However it seems that sha sums change and they don’t get loaded into the website.
Yes, that was what I meant with including it in the HTML.
Well, that’s all I could think of, difficult to debug without access to the project. Do you have the ability to test it on a different machine? Might be useful to see if it works there.
Thank you for your suggestions. I don’t have another machine to try, however I’ll continue trying on different project and finding diffs in configs and initializers.