Why does this happen?
This error is normally returned when you remove your Magento theme directly from app/design or vendor/ directory. Removing theme files directly from the directory is not a Magento standard way anymore. Magento 2 has a CLI command to remove themes safely i.e.
Command usage:
magento theme:uninstall [--backup-code] [-c|--clear-static-content] {theme path} ... {theme path}
{theme path}
is the relative path to the theme, starting with the area name. For example, the path to the Blank theme supplied with Magento 2 isfrontend/Magento/blank
.--backup-code
backs up the Magento 2 codebase as discussed in the paragraphs that follow.--clear-static-content
cleans generated static view files, which is necessary to cause static view files to display properly.
Solution
STEP 1 : File Operations
- Delete the content from
app/design/frontend/<Vendor>
. - Delete all the content of folder
var/view_preprocessed
&pub/static/frontend
.
STEP 2 : DB Operations
Go to your theme
table and delete the entry for your created theme.
After that…
Go to your core_config_data
table and search for theme
and you will get path records like design/theme/theme_id
replace your default theme id in it. You can run the following command in PHPMyadmin or your database CLI.
SELECT * FROM `core_config_data` WHERE `path` LIKE '%design/theme/theme_id%'
STEP 3 : Flush cache
Flush your cache php bin/magento cache:flush
Very bad explanation of your tutorial. It’s basically useless.
Hi Raymond,
Thanks for your comment and I’m sorry to hear that you did not find the tutorial helpful.
Could you provide more details of the issue you are facing so I can update the tutorial accordingly? Also note that this was posted a couple of years ago for early version of Magento so things might have changed for the version you’re using.
I look forward to hearing from you.
Thanks