0

we have a site that was running fine, we just move site to new instance and got an error. All js file's map urls, that we define in require-config.js file not loading on frontend.

Like, we define -

var config = {
    map: {
        '*': {
                customjs : 'Magento_Theme/js/custom'
            }

        }
};

on frontend,site making url - http://localhost/Mysite/pub/static/frontend/Magento/Commerce/en_US/customjs.js

And giving error

File Not Found Error

To make it work, I removed pub/static/all_files and re-run the static-content deploy command, cache flush, re-index multiple times, but non making effect.

Please help me to solve it. Thanks

  • please check my answer – Rakesh Donga Jan 30 at 10:03
  • thx for ur answer, But what is the issue with mine declaration of file path. This is just an example, we have around 10more files that are not loading. Please suggest any common solution........ – Atul Jan 30 at 10:20
0

you can update your code this way

var config = {
    map: {
        '*': {
                customjs : 'Magento_Theme/js/customjs'
            }

        }
};

after re-run the static-content deploy command

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

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.