Hi Im almost at the goal line with my upgrade. Im have been dealing with dynamic reload on js/css changes and it is causing some issues.
As part of the upgrade i have gone with jsbundling (esbuild )and cssbundling (bootstrap).
I think that a part of my issue is that I don’t fully understand what esbuild/sprockets start and stop.
In order to get hot reloading to work i found that i had to run
assets:clobber as i had issues with rails reading the digest versions of application.js and stylesheet.css from
public/assets. After having cleaned out
public/assets dynamic reloading seems to work. I don’t fully understand why.
The issue is now that i get following errors in my chrome console:
GET http://localhost:3000/webfonts/fa-solid-900.woff2 404 (Not Found) application-4dcb73f3da433d833f26d81dbcf900551080dd96edea864ecb90f8100963eae5.css:1 GET http://localhost:3000/webfonts/fa-solid-900.woff 404 (Not Found) application-4dcb73f3da433d833f26d81dbcf900551080dd96edea864ecb90f8100963eae5.css:1 GET http://localhost:3000/webfonts/fa-solid-900.ttf net::ERR_ABORTED 404 (Not Found)
and in rails log (only one of them is shown here):
web_1 | 18:53:02 web.1 | I, [2022-09-26T18:53:02.849005 #40] INFO -- : Started GET "/webfonts/fa-solid-900.ttf" for 172.25.0.1 at 2022-09-26 18:53:02 +0000 web_1 | 18:53:02 web.1 | I, [2022-09-26T18:53:02.849949 #40] INFO -- : Cannot render console from 172.25.0.1! Allowed networks: 127.0.0.0/127.255.255.255, ::1 web_1 | 18:53:02 web.1 | F, [2022-09-26T18:53:02.857123 #40] FATAL -- : web_1 | 18:53:02 web.1 | ActionController::RoutingError (No route matches [GET] "/webfonts/fa-solid-900.ttf"):
This is fairly obvious as I just cleared out
Now if i run
public/assets is rebuild and after an application restart I still get the error:
web_1 | 19:06:46 web.1 | I, [2022-09-26T19:06:46.913294 #40] INFO -- : Started GET "/webfonts/fa-solid-900.ttf" for 172.25.0.1 at 2022-09-26 19:06:46 +0000 web_1 | 19:06:46 web.1 | I, [2022-09-26T19:06:46.914006 #40] INFO -- : Cannot render console from 172.25.0.1! Allowed networks: 127.0.0.0/127.255.255.255, ::1 web_1 | 19:06:46 web.1 | F, [2022-09-26T19:06:46.922051 #40] FATAL -- : web_1 | 19:06:46 web.1 | ActionController::RoutingError (No route matches [GET] "/webfonts/fa-solid-900.ttf"):
and just to really set my self back to square zero hot reloading is not working. The
assets/builds gest a application.js (with sourcemap) but development now uses the
public/assets digest version. Thus I run run
assets:clobber once more, but the is very circular.
Does anyone have any idea how to get me out of this bind?
and for my development environment i have:
# Debug mode disables concatenation and preprocessing of assets. # This option may cause significant delays in view rendering with a large # number of complex assets. config.assets.debug = false #To get assets to work in dev config.assets.compile = true # Suppress logger output for asset requests. config.assets.quiet = true