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!

  • You try to run static content deploy? – Khoa TruongDinh Jun 26 '16 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 Jun 26 '16 at 10:00
  • @Khoa Yes, I did run static content deploy as well. – omencat Jun 26 '16 at 20:19
  • @KAndy, Should it not be there? This is a magento2 installation and I didnt manually upload anything. – omencat Jun 26 '16 at 20:20
  • did u try to give permission to the pub folder after running static content deploy ? – Reena Parekh Jun 27 '16 at 6:13
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, privacy policy and cookie policy

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