Re-opening an old issue as it was improperly formatted and abandoned.
The error 'Required parameter 'theme_dir' was not passed' appears after adding a custom theme to a fresh install in directory: <magento root dir>/app/design/frontend/<Vendor name>/<Theme name>/. The backend is still accessible and functions properly, as does the frontend when the Magento/blank or Magento/luma themes are applied, but the error occurs once the custom theme has been applied.
--create-project command, as documented by Magento.app/design/frontend folder.Content > Design > Configuration.setup:upgrade, indexer:reindex and cache:flush commands.app/bootstrap.php.When viewing the theme table of the magento database within phpmyadmin, I can see that the custom theme path is correct, but the 'type' is set to 1.
When searching the term 'theme' within the core_config_data table, I can see a single entry:
scope: store
scope_id: 1
path: design/theme/theme_id
value: 4
This value corresponds correctly with the custom theme id under the theme table.
The problem also occurs when design/theme/id points to a theme which does not exist in the theme table. So I believe that my initial problem was a permissions error, though this does highlight an area that the installation process could perhaps be improved.
You can ref here #issue5294
Ah thanks mate.. I've only recently begun to raise issues here. Still getting used to best practice.
Hello @JoshuaFlood, thank you for your report. Unfortunately I wasn't able to reproduce this issue. Could you please add more details?
I'm away from home at the moment but will attempt to reproduce it myself on the weekend and update the info here afterwards.
After a little exploring on my existing server, it seems that the problem occurs when the 'virtual' column of the themes table is set to 1, although in previous versions I was able to assign a value of 0 and fix the problem. Now, when the value is changed, it gets reset to 1.
I worked out the problem, but it might be a duplicate issue. The problem is that I had used a database from a previous installation, where my custom theme was active, but I had not include the custom theme in the fresh magento install, so design/theme/theme_id in core_config_data referenced a theme which did not exist in the theme table. I simply had to revert the value of design/theme/theme_id to 2 (luma) and flush cache/reset permissions, then everything worked fine.
In order to prevent this in future though, perhaps a check could be implemented during install to see if the value of design/theme/theme_id exists as an id in the theme table and if not, revert to luma and alert the user once installation is complete?
Just battling to get a stable production environment at the minute. Once that's done I'll give it a go writing something if there are no obvious drawbacks I've overlooked.
@JoshuaFlood, thank you for detailed explanation. I'm closing this issue, as it's not reproducible on clean magento installation.
In order to prevent this in future though, perhaps a check could be implemented during install to see if the value of design/theme/theme_id exists as an id in the theme table and if not, revert to luma and alert the user once installation is complete?
I may create issue here: https://github.com/magento/community-features
I got the same issue Required parameter 'theme_dir' was not passed, found the cause and solution for this, more detail wrote here:
https://mrvts.wordpress.com/2018/08/21/magento-2-required-parameter-theme_dir-was-not-passed-after-manually-adding-theme-remove-theme-delete-theme/
@vtransy and if your link dies then nobody will ever know your fix. Nice
@Eddcapone it's working, maybe wordpress is blocked at your side, here is screen shot:

@vtransy It works NOW. But my point is, what happens in 1-2 years? Will it work then too? You should always add the needed informations in your comment too as backup. Thanks for the screenshot.
I follow this tutorial: https://magentip.com/required-parameter-theme_dir-was-not-passed-magento-2/
In my case, I use solution 3 to remove invalid theme from Magento 2 database
Cause of the error
The error happens when you remove a theme folder of Magento 2 in app/design/frontend/
Magento 2 will throw this error when it found theme in database, but couldn鈥檛 find theme folder as you had deteled it.
Solution
Solution 1: Update current theme in Admin
In Magento 2 admin section, go to: Content => Design => Configuration and update current theme to the valid theme
Solution 2
Remove invalid theme from database with this command
mysql -u <dbuser> -p -e "delete from <dbname>.theme where theme_path ='<Vendorname>/<themename>' AND area ='frontend' limit 1"
Solution 3
Remove theme from database using Magento 2 CLI
bin/magento theme:uninstall --clear-static-content frontend/Magento/blank
Remember to flush cache
php bin/magento cache:flush