Magento 2.4.3 – Refused to execute Script

javascriptmagento2.4.3static-contenttheme

I just created a staging environment for my live server and I have some issues with my porto theme after that.

I can see it in the inspector "Refused to execute script "script path/frontend/Smartwave/porto_child/nb_NO/js/jquery.stellar.min.js" And when I go to my stage environment I do not find jquery.stellar.min.js but I do find it on my live environment. I did read that this could be an issue, any suggestions on how to fix this?

I have tried to remove deployed_version.txt file and run enter image description here

No luck

Thanks in advance.

Best Answer

Try to run remove pub/static/frontend, and var/view_preprocessed/pub/static/frontend, before deploy static content:

rm -r pub/static/frontend
rm -r var/view_preprocessed/pub/static/frontend
bin/magento setup:static-content:deploy -f --area frontend

If the issue persists, assume your Magento root folder is /var/www/html, and run the command: grep -r jquery.stellar.min /var/www/html to see if jquery.stellar.min.js is declared anywhere the add results to your question (run that command in both staging and live server). Also, add the screenshot for the error in the console tab in the Developer tool too. I'll help.

Related Topic