1

I am trying to deploy the static content but in frontend and backend require js is not being loaded see error :

Loading failed for the <script> with source “http://example.com/dev/pub/static/version1525976399/frontend/Sm/market/en_GB/requirejs/require.js”.
dev:20
Loading failed for the <script> with source “http://example.com/dev/pub/static/version1525976399/frontend/Sm/market/en_GB/mage/requirejs/mixins.js”.
dev:21
TypeError: require.config is not a function[Learn More] 

I have tried following command :

php -d memory_limit=5G bin/magento setup:di:compile
For Deployment:
php -d memory_limit=5G bin/magento setup:static-content:deploy

But it's not helped. How to resolved it ?

  • I think that your js is not well included via requirejs, Try to clean the pub/static content then run : php bin/magento setup:static-content:deploy -f if it doesn't work, please post you code to how you included your js ! – PЯINCƏ May 11 '18 at 13:50
5

If you are using developer or default mode then try to use:

php bin/magento setup:upgrade 
php -d memory_limit=5G bin/magento setup:di:compile
php -d memory_limit=5G bin/magento setup:static-content:deploy en_GB en_US -f
php bin/magento cache:clean

Hope this helps

| improve this answer | |
5

This will happen if you clear the pub/static folder instead of pub/static/frontend. You'll lose the .htaccess in there which messes things up royally! Restore pub/static/.htaccess from your local files/backup and it'll correct.

| improve this answer | |
  • This is the most useful answer and should be the accepted one. Worked! – Bovolio Dec 4 '19 at 17:51
  • Does .htaccess needs be present in the directory if I am using nginx? – Zoya Dec 19 '19 at 5:28
2

Run below command and check

php bin/magento setup:upgrade 
php bin/magento setup:static-content:deploy en_GB en_US 
php bin/magento cache:clean
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.