Question

In my Magento 2 site every time I try to clear the static file cache and try to reload the page in the frontend, several errors come out in the JS console, as if there were continuous conflicts between the various js files.

But when I try to clean up the Magento cache and reload the page in the frontend, the console problems disappear. Has this happened to anyone?

It is as if Magento does not regenerate the js files in the pub / static folder ...

What could I do?

Was it helpful?

Solution

php bin/magento setup:static-content:deploy -f

This should do it !

UPDATE:

php bin/magento setup:upgrade
php setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush

You should also be aware that due to Linux file permissions sometimes you need to give permission to the apache user to "use" the files created.

sudo chmod -R  +775  .
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top