We’re working on building a new theme using the Sage starter theme/framework and all is going well. However, we have a major inconvenience when attempting to make any changes to Javascript files. When any JS files are changed within the theme, WebPack seems to trigger an infinitely looping hot reload of the page. This causes us to have to kill the WebPack process + restart it with yarn start for every change made to JS.
We have spent a substantial amount of time researching what could be causing this but have not been able to find anything which works.
For clarity, we have a standard Wordpress install, running on MAMP with Sage as our development theme of choice.
Thanks again for your response, however as I outlined in my initial message, I’m not using a local dev hostname. Do I need to create one in my /etc/hosts file?
I’m also not using Trellis or Bedrock; just a standard WP install (as I had great difficulty getting either of those to play nicely either, but that’s for another time…).
Are you suggesting the issue may be caused by our devUrl still referencing “localhost”? Is that what is causing the infinite loop?
I’m very pleased to report the use of a VirtualHost domain appears to have done the trick! We can now freely make changes to all files within the theme without causing any infinite loops!
Thank you very much for your help - what a bizarre and highly under documented problem.
Yeah, I thought that too - however it isn’t. That is just a standard main.scss file which is used for importing all my components. I’m also getting a hot reload infinite loop on js changes now too. I have to kill the server and restart every time. Really odd!