5

I have enabled JS minification and Merging while in developer mode. Then i enabled production mode.

Cleared cache and ran below commands:

php bin/magento setup:upgrade

php bin/magento indexer:reindex

php bin/magento setup:di:compile

php bin/magento setup:static-content:deploy

but still i get 404 error for all JS files in console.

Magento still tries to look for Non-minified version of JS files!

Note: In developer mode everything works fine!

asked Aug 23, 2019 at 9:06

1 Answer 1

0

I fixed this by editing .htaccess file in /pub/static

uncommented line 16 so it looks like this

RewriteBase /pub/static/

I then ran

bin/magento deploy:mode:set production

again and it cleared the errors.

All js and css are minified and merged correctly

Piyush
5,9249 gold badges35 silver badges67 bronze badges
answered Nov 19, 2024 at 7:26

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.