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 ?

1
  • 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 ! Commented May 11, 2018 at 13:50

3 Answers 3

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

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.

2
  • This is the most useful answer and should be the accepted one. Worked! Commented Dec 4, 2019 at 17:51
  • Does .htaccess needs be present in the directory if I am using nginx? Commented Dec 19, 2019 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 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.