'magento 2 Required parameter 'theme_dir' was not passed

After Theme installation and applied the theme in backend (System-> Configuration-> General-> Theme),clear the cache and refresh front end it gives an error in magento2.the error like below

Required parameter 'theme_dir' was not passed
#0 /var/www/demos/magento2new/vendor/magento/framework/View/Design/Fallback/Rule/Theme.php(69): Magento\Framework\View\Design\Fallback\Rule\Simple->getPatternDirs(Array)
#1 /var/www/demos/magento2new/vendor/magento/framework/View/Design/FileResolution/Fallback/Resolver/Simple.php(93): Magento\Framework\View\Design\Fallback\Rule\Theme->getPatternDirs(Array)
#2 /var/www/demos/magento2new/vendor/magento/framework/View/Design/FileResolution/Fallback/Resolver/Simple.php(64): Magento\Framework\View\Design\FileResolution\Fallback\Resolver\Simple->resolveFile(Object(Magento\Framework\View\Design\Fallback\Rule\Theme), 'i18n/en_US.csv', Array)
#3 /var/www/demos/magento2new/vendor/magento/framework/View/Design/FileResolution/Fallback/LocaleFile.php(42): Magento\Framework\View\Design\FileResolution\Fallback\Resolver\Simple->resolve('locale', 'i18n/en_US.csv', 'frontend', Object(Magento\Theme\Model\Theme), 'en_US', NULL)
#4 /var/www/demos/magento2new/vendor/magento/framework/View/FileSystem.php(103): Magento\Framework\View\Design\FileResolution\Fallback\LocaleFile->getFile('frontend', Object(Magento\Theme\Model\Theme), 'en_US', 'i18n/en_US.csv')

added the registration.php in theme but front end is blankpage...



Solution 1:[1]

If you are building a new theme, or trying to figure out why your newly installed theme is crashing your site, it may be due to a capitalization issue. In linux, make sure the directory your theme is located in has the correct capitalization required for it to all work properly. It is not guaranteed that the theme developer was using a linux system (they may have been using windows, and yes, its possible to run magento + php + windows although its a cludge). This would allow the theme developer to ignore directory / filename capitalization, and possibly release a theme that isn't really compatible with a filesystem that forces capitalization.

In linux you can have ALL of these files in one directory...

  • test.php
  • Test.php
  • TEST.php
  • tEst.php
  • test.PHP

you get the idea....

$theme->getFullPath() may output something like /design/Yourcompany/Yourtheme but your actual path may be design/Yourcompany/yourtheme. That capitalization is very strict on linux systems, and will cause all kinds of headaches.

Its also very important that the registration.php file has the same capitalization that the directory, and the output of $theme->getFullPath() has. All of this has to match.

If you intend on debugging $theme->getFullPath(), its in the \Magento\Framework\View\Design\Fallback\Rule\Simple class.

Solution 2:[2]

When you are adding or editing product then Go to Design section and change layout option. example

Solution 3:[3]

I faced the same issue, fixing theme folder permission solved the problem

Solution 4:[4]

Delete Row having theme not defined in your system in theme table ..

if you created new theme it should be shown here... delete another theme which is not active or unnecessary..

Solution 5:[5]

From the error seems that you have a theme configured which doesn't exist on the file-system (any more). It can be easily fixed by selecting a valid theme instead. Go to Content -> Configuration, select the scope (global, website, store_view) and change the theme.After you've done that you should also remove it from Content -> Themes.

(OR)

This can also be the case if your theme directory does not have the proper permissions

Solution 6:[6]

Steps:

  1. Change the value for theme_id for the current store:

    SELECT * FROM core_config_data WHERE path LIKE 'design/theme/theme_id';
    

    UPDATE Stable theme id here.

  2. Flush configuration cache:

    php bin\magento cache:flush config
    

Solution 7:[7]

The error happens when you remove a theme folder of Magento 2 in app/design/frontend// , but not remove theme data from database.

In Magento 2 admin section, go to: Content => Design => Configuration and change theme to the valid theme will fix this error

Another solution is to remove invalid theme from database using this MySQL command

mysql -u <dbuser> -p -e "delete from <dbname>.theme where theme_path ='<Vendorname>/<themename>' AND area ='frontend' limit 1"

Reference source: https://magentip.com/required-parameter-theme_dir-was-not-passed-magento-2/

Solution 8:[8]

at contect->configuration-> select luma theme on your store save & at content->Themes delete custom theme due to which you are facing issue after that select theme which you want this error will not appear

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 illright
Solution 3 Aref Ben Lazrek
Solution 4 lalit mohan
Solution 5 Ashwin Shahi
Solution 6 JJJ
Solution 7 Hung Tran
Solution 8 Hassan Ali Shahzad