0

I recently did an upgrade, compile, reindex, flush, clean on my magento 2.0.7 instance. Everything is working fine except on the backend interface I am getting 404 not found on anything in the pub/media/js/directory. Specifically the jscolor.js file used in the color picker on the admin backend. I checked the permissions and confirmed the files are in fact there. So I am looking for any tips on how to resolve.

chrome debug window shows its trying to access: https://myurl.com/index.php/pub/media/js/jscolor.js

Thanks!

6
  • You try to run static content deploy? Commented Jun 26, 2016 at 8:48
  • why jscolor.js is located in media folder? Do you upload it with WYSIWYG editor? Normally all js files should be placed in pub/static folder.
    – KAndy
    Commented Jun 26, 2016 at 10:00
  • @Khoa Yes, I did run static content deploy as well.
    – omencat
    Commented Jun 26, 2016 at 20:19
  • @KAndy, Should it not be there? This is a magento2 installation and I didnt manually upload anything.
    – omencat
    Commented Jun 26, 2016 at 20:20
  • did u try to give permission to the pub folder after running static content deploy ? Commented Jun 27, 2016 at 6:13

1 Answer 1

0

Add app\code\Vendor\Modulename\view\frontend\requirejs-config.js

var config = {
    map: {
        '*': {
            'jsfilename': 'Vendor_Modulename/js/jsfilename'
        }
    }
};
e.g.If JS file name is jscolor.js, jsfilename = jscolor

Add jscolor.js iin below path

app\code\Vendor\Modulename\view\frontend\web\js\jscolor.js

Run below command

chmod -R 777 var pub

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

If still there is a 404 not found issue, remove below file and again run above command.

pub\static\_requirejs\frontend\Magento\luma\en_US\requirejs-config.js

If you are using different theme, use theme name instead of **luma** in above command.

Your Answer

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

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