Showing results for 
Search instead for 
Did you mean: 

Compilation failure

Compilation failure

Hi all!


I would like to switch my store to production mode, but I'm not able to complete compilation without issues. 

So far I've tried these commands: 


bin/magento setup:upgrade

bin/magento indexer:reindex

bin/magento deploy:mode:set production -s

bin/magento setup:di:compile

Unfortunately in the setup:di:compile command, I get my errors: 


Class Magento\GiftCardAccount\Helper\Data does not exist


This is the stack trace: 

Exception trace:
 () at /home/shopkegels2/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:37
 Magento\Framework\Code\Reader\ClassReader->getConstructor() at /home/shopkegels2/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassReaderDecorator.php:35
 Magento\Setup\Module\Di\Code\Reader\ClassReaderDecorator->getConstructor() at /home/shopkegels2/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Area.php:53
 Magento\Setup\Module\Di\Code\Reader\Decorator\Area->getList() at /home/shopkegels2/public_html/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php:109
 Magento\Setup\Module\Di\App\Task\Operation\Area->getDefinitionsCollection() at /home/shopkegels2/public_html/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php:84
 Magento\Setup\Module\Di\App\Task\Operation\Area->doOperation() at /home/shopkegels2/public_html/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php:56
 Magento\Setup\Module\Di\App\Task\Manager->process() at /home/shopkegels2/public_html/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php:187
 Magento\Setup\Console\Command\DiCompileCommand->execute() at /home/shopkegels2/public_html/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at /home/shopkegels2/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at /home/shopkegels2/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /home/shopkegels2/public_html/vendor/magento/framework/Console/Cli.php:96
 Magento\Framework\Console\Cli->doRun() at /home/shopkegels2/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /home/shopkegels2/public_html/bin/magento:23

I can find very little information about this issue, and the steps I've tried to solve the issue doesn't work. 

I've also tried clearing all cache and var/generation folder, but nothing helps. 


Anyone an advice?







Re: Compilation failure

Have you check module GiftcardAccount with Helper Data.php class exist or not?

If not please check from which file above class is calling remove those class from file if Data.php file not exist at above file or if Data.php file exist check __construct() function with dependency of class.

If Issue Solved, Click Kudos/Accept As solutions.

Re: Compilation failure

Hi Rakesh


I've tried to find the module in the var/generation file and vendor/magento, but I can't find any folder with that name. 

Where can I find this module?



Re: Compilation failure

You need to search inside app/code folder for above class path and vendor/magento path if any place found remove those from file and check.
Might be anywhere inside app/code defined above class.
If Issue Solved, Click Kudos/Accept As solutions.

Re: Compilation failure

Ok, I've searched the directories. 


Nothing found in app/code


A lot of references in vendor/magento, in the luma theme and blank theme. 

Should I just remove the luma theme?


Re: Compilation failure

Or, is there an easier way to just create this class?

Re: Compilation failure

Yes just create those class and run di compile again.
If Issue Solved, Click Kudos/Accept As solutions.

Re: Compilation failure

Ok, can you give me some guidelines how to create this class? 

What is the specific class name in this case?

Re: Compilation failure

To be clear: in all of the files, I cannot find the whole string: Magento\GiftCardAccount\Helper\Data

I only can find folders with GiftCardAccount in...

Re: Compilation failure