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

2
  • please check my answer Jan 30, 2019 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, 2019 at 10:20

1 Answer 1

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 
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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