Magento – Magento 2 js not working

magento2magento2.2.2

On one of my websites, sometimes some of my customs js not working, I have embedded them on a template file. I have checked the console of the browser it shows an error, also sometimes CSS or some portion like sign-in/sign out or logo will not display.

to fix it I have to run content deploy every time, I just need to know the root cause of it. What will be the best practices to fix this kind of issue, so that I don't have to run content deploy every time, as the website is already live, and it seems very disappointing if suddenly some function stop working.

Also, I have noticed that content deploy is not working with -f is that was also an issue, which brings these problems.

Thanks

Best Answer

You can run the static-deploy in verbose mode with -vvv and that might show more output assuming its hitting an error when your custom JS is not there.

Related Topic