I’m trying to get back into rails development and recently started a project that I initiated with
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.
What command do you start the js precompilation with? Did you forget
--watch as argument?
I have a
/bin/dev server with following
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.
How are you including the js build in your HTML? Are you using Turbo as well?
Does a “hard refresh” fix the path in the HTML?
Can you elaborate on including js build in html? I’m using standard
The hard refresh (trying it on Safari after Cmd+Option+E) does not help.
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.
bundle exec rails tmp:cache:clear