Magento 2 – Frontend Layout Not Working After Upgrade to 2.1

magento-2.1magento2upgrade

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: 
frontend/Srm/cookbook/en_US/css/styles-l.less
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: 
frontend/Srm/cookbook/en_US/css/styles-m.less
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

Best Answer

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 !!

Related Topic