My Magento 2.08 was working fine, but due to new features introduced in Magento 2.1 and curiosity of knowing how upgrade works in Magento 2, I tried to upgrade my Magento to latest stable version of Magento, i.e. Magento 2.1.

Everything went fine and I found admin panel functionality was working fine after upgrade.

But frontend is not working anymore now.

I inspected the problem and found that styles-m.css and styles-l.css are showing 404 not found error in page source.

Also below is my system.log file content:

[2016-08-10 04:09:15] main.CRITICAL: 
Compilation from source: 
Unable to get content for 'frontend/Srm/cookbook/en_US/Magento_Theme/css/source/module/_collapsible_navigation.less' [] []
[2016-08-10 04:09:15] main.CRITICAL: 
Compilation from source: 
Unable to get content for 'frontend/Srm/cookbook/en_US/Magento_Theme/css/source/module/_collapsible_navigation.less' [] []

I also tried to run grunt exec:<themename>, but I got below message:

A valid Gruntfile could not be found. Please see the getting started guide for
more information on how to configure grunt: http://gruntjs.com/getting-started
Fatal error: Unable to find Gruntfile.

Please help me to resolve this problem.

Thanks in advance

  • Have you check you compilation mode in admin ? Commented Aug 10, 2016 at 5:27
  • I have tried to compile, but no luck. Commented Aug 10, 2016 at 5:48
  • Compilation mode must be client side when we deploying. kindly check it. Commented Aug 10, 2016 at 6:22
  • How can I check and change compilation mode. Please help. I am new to magento 2. Commented Aug 10, 2016 at 6:50

3 Answers 3


I suggest you to turn on theme to developer mode if your are not on production mode.

Either by,

php bin/magento deploy:mode:set developer

Or, Goto app/etc/env.php

change 'MAGE_MODE' => 'default'' to MAGE_MODE' => 'developer',

After all, follow these steps:

  1. Run Command Prompt

  2. Navigate to magento 2 installation directory.

  3. Run

php bin/magento setup:static-content:deploy

  1. Navigate to var directory.

  2. Run

rm -rf var/cache/*

rm -rf var/composer_home/*

rm -rf var/generation/*

rm -rf var/page_cache/*

rm -rf var/view_preprocessed/*

  1. Run

php bin/magento indexer:reindex

Now, it must work fine !!


You can try to regenerate the static content by doing the below steps -

1. Delete all folders under pub/static
2. Delete var/cache
3. Delete var/composer_home
4. Delete var/generation
5. Delete var/page_cache
6. Delete var/view_preprocessed

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

php bin/magento setup:static-content:deploy
  • php bin/magento setup:static-content:deploy is not working for magento 2.1. Commented Aug 10, 2016 at 5:57
  • I am getting this error: [InvalidArgumentException] There are no commands defined in the "setup:static-content" namespace. Commented Aug 10, 2016 at 5:58
  • Try to give 777 permission to both pub and var folders and check. Commented Aug 10, 2016 at 9:23

You can find out compilation mode from here :

Store >> Configuration >> Developer >> Frontend Development Workflow >> Workflow type >> 

Select "Client side less compilation"

Remove Var/ and pub/static/

Run Below command

php bin/magento setup:static-content:deploy

Check now still issue or not.

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.