Cannot see changes in Magento 2 js and css

10,516

Solution 1

step 1. delete all folders under pub/static/frontend

step 2. delete cache folder under var/cache

Now open your command prompt and go to your root installation of magento 2 and fire the following commands

step 3. php bin/magento setup:static-content:deploy

step 4. php bin/magento indexer:reindex

The above step worked for me. I hope it will work for you also.

Let me know if you still facing any problem.

Solution 2

step 1.

rm -rf pub/static/frontend/*

step 2.

rm -rf var/cache/*

step 3.

php bin/magento s:s:d -f

step 4.

php bin/magento indexer:reindex

The above step worked for me. I hope it will work for you also.

Share:
10,516
Yatin Khullar
Author by

Yatin Khullar

I am Yatin Khullar a PHP programmer, loves challenges. My E-mail Id: [email protected]

Updated on June 16, 2022

Comments

  • Yatin Khullar
    Yatin Khullar almost 2 years

    I am new to magento 2 and I am creating extension for it.

    But I am unable to see any js and css changes.

    When i check on my source code my js file custom.js and css file custom.css is loaded properly but i am unable to see any of my changes.

    I tried to clear cache and didn't get any result.

    I cleared cache from backed and manually as well and disabled all cache too.