Description
After upgrading to Webpacker 5.4.3 from 5.1.1, we got a bunch of errors when firing any our apps:
ERROR in chunk <appname> [entry]
[name].[chunkhash].js
Cannot use [chunkhash] for chunk in '[name].[chunkhash].js' (use [hash] instead)
One other thing to note is that Webpacker would go and compile all of the assets by default every time you hit an entrypoint instead of letting the webpack-dev-server
handle that part. So, every time we were hitting a new entrypoint in development, Webpacker would go and take 20+ seconds to recompile.
As a part of the upgrade documentation, you are asked to upgrade webpack-dev-server
and @webpack-cli
to the latest versions and that is where the issues lies.
Managed to find: https://stackoverflow.com/questions/69757518/hot-reloading-not-working-rails-6-and-webpacker-5-4-3-gem and the very last comment says that the user downgraded to V3 of both webpack-dev-server
and @webpack-cli
and everything works fine. We did the same thing and had the same success and now webpack-dev-server
does the recompiling and Webpacker doesn't.
There is something going on between the two libraries above and Webpacker 5.4.3.