Questions tagged [setup-di-compile]

Denotes questions related to the setup:di-compile command of Magento 2. This command is used to compile the setup.

Filter by
Sorted by
Tagged with
24
votes
4answers
4k views

Which compilation commands are needed in developer mode and when?

Can somebody give me instructions when to run which compilation commands in Magento 2 developer mode? I'm not sure if I understand it right yet. In the devdocs, developer mode is described as follows:...
16
votes
5answers
4k views

Magento 2.3.3 Fails on magento setup:di:compile with an error mentioning InvoiceFlexFieldProcessorInterface

I have installed the new Magento 2.3.3 version. After I have run the command: php bin/magento setup:di:compile I have Faced the following error: PHP Fatal error: Interface 'Vertex\Tax\Model\...
13
votes
3answers
39k views

Magento2 - setup:di:compile

I have been working in a project with some custom code... this is our first "medium" Magento 2 project, so (as all people here I think) every day we learn new things, and we have to change the way to ...
12
votes
1answer
10k views

Cannot declare interface , because the name is already in use

After creating a simple interface in my new module. I typed in bin/magento setup:di:compile, and I get an error saying that the name is already in use. Here is my code: namespace Company\Test\Api; ...
11
votes
5answers
5k views

Magento 2 - setup:di:compile throws No tokens were provided error

In magento 2 when I run setup:di:compile I get the following error: [Zend\Code\Exception\RuntimeException] No tokens were provided How to solve this problem? I disabled all additional ...
9
votes
4answers
4k views

Classnames 'Void' inside vendor/magento/

I'm trying to re-compile using php bin/magento setup:di:compile But when I run this command, I get: Fatal error: Cannot use 'Void' as class name as it is reserved in /var/www/html/magento/...
8
votes
3answers
1k views

Magento2 which command Run and when to Run

Kindly Clear Difference Between php bin/magento cache:flush and cache:clean and when they need to Run . which tasks Output to need cache:flush or clean ** and which task need these Commands => **di:...
8
votes
2answers
3k views

M2/ How to fix “Incompatible argument type: Required type: string. Actual type …”

A compilation was started. Interception cache generation... 6/7 [========================>---] 85% 1 min 404.0 MiB Errors during compilation: SkyFox\Supplier\UI\DataProvider\Supplier\...
7
votes
2answers
770 views

Magento 2: Run setup:di:compile a Specific Module

Is it possible to di compile to specific module instead of whole magento di compile ? Because, Whole Magento take a long time to compile. So, is it possible to di compile to specific module. php bin/...
6
votes
1answer
6k views

Notice: unserialize(); Error at offset in Magento 2.2

This code not working in Magento 2.2, But it's working in Magento 2.1. I am facing this error Notice: unserialize(); Error at offset 0 of 168 bytes in /var/www/html/M2/app/code/Vendor/Module/Block/...
6
votes
1answer
763 views

Magento 2: Why di compile is not 100%?

When we run php bin/magento setup:di:compile Why all are not will be 100% & 7/7? $ php bin/magento setup:di:compile Compilation was started. %message% 0/7 [>---------------------------] 0% ...
6
votes
1answer
4k views

Problems with less variables in _theme.less

I use below media queries in my custom _theme.less like & when (@media-common = true) { } but when I execute this command bin/magento setup:static-content:deploy I get variable @media-common is ...
5
votes
3answers
17k views

Uncaught TypeError: Argument 1 passed to […] must be an instance of

I have been having this issue for several weeks now and after looking through similar issues on this site and others, I still can't figure out how to solve this problem. After successfully executing ...
5
votes
1answer
5k views

Magento 2: Error during compilation Incompatible argument type

In Continue with Magento 2: Error during compilation I have below error while running php bin/magento setup:di:compile Errors during compilation: Custom\Module\Model\ResourceModel\...
5
votes
3answers
523 views

Cannot put magento 2 into production mode due to an error in setup:di:compile:

We are trying to put a site into production mode but we get errors during the setup:di:compile step. Below all the details I think are relevant: Php 7.0.15 I have cleaned the cache with bin/magento ...
5
votes
1answer
3k views

Magento 2: How to fix incorrect permissions after executing setup:upgrade and/or setup:di:compile

After running setup:upgrade and di compile from the bin directory, permission and ownership is reset and the magento store stops working. It works if I manually reset the permission. When the var/...
4
votes
3answers
5k views

How to resolve unserialize issue [closed]

My extension has stopped working since updating to Magento 2.2.0 When running di:compile we get the following error: Errors during compilation: Vendor\Module\Model\ResourceModel\...
4
votes
2answers
2k views

setup:di:compile error because of duplicated class of data-migration-tool

I'm running into following fatal error when trying to execute the setup:di:compile command: Fatal error: Cannot declare class Migration\Step\Version11410to2000Test, because the name is already in ...
4
votes
3answers
2k views

Magento 2 - setup:di:compile (general question)

This is a general question about the magento 2 cli, and what the setup does. Every time i want to install or uninstall a module I have to run the following command. setup:di:compile What does this ...
4
votes
1answer
47 views

Magento 2 What is the fastest way to get construction changes?

Whenever I made any changes on the construction method, I need to do bin/magento setup:di:compile to get any changes on my code. It was wasting my time, how can I get any changes faster than have to ...
4
votes
1answer
232 views

Magento-2.1 : Warning: Missing argument 2 for OAuth\Common\Consumer\Credentials::__construct()

I have used below code, it's working in Magento-2.2 but not working in Magento-2.1 after code compilation. public function __construct( \OAuth\Common\Consumer\CredentialsFactory $...
4
votes
3answers
4k views

Magento 2 PHP Fatal error: Class not found when compiling

When I compile I get this error: PHP Fatal error: Class 'Magento\Catalog\Controller\Adminhtml\Category\Image\Upload' not found in /var/www/html/magento/app/code/Plazathemes/Override/Controller/...
3
votes
2answers
5k views

Disable setup:di:compile

Maybe this is a very silly question. I can not understand why I must run the command setup:di:compile every time I make changes to custom modules, to see the results when I am in developer mode. Can ...
3
votes
2answers
228 views

DI compile step fails after update to 2.3.5

Using Magento Cloud, the DI compile step keeps failing after upgrading from 2.3.3 to 2.3.5 via composer and pushing the changes up. The error is the same every time I've tried, which is: PHP Fatal ...
3
votes
3answers
770 views

CLI: What is the difference between “setup:static-content:deploy” and “dev:source-theme:deploy”?

I wanto to know the difference between: php bin/magento setup:static-content:deploy and php bin/magento dev:source-theme:deploy I know that second receives as options name of specific vendor, ...
3
votes
3answers
7k views

Magento 2 Compile Generation Does Not Exist

I'm using Magento 2 CE Version 2.1.0 C:\wamp\www\magento2>C:\wamp\bin\php\php5.6.19\php.exe bin/magento setup:di:compile Compilation was started. %message% 0/7 [>---------------------------] ...
3
votes
1answer
1k views

Magento 2: controller preference not working after setup:di:compile

I need to rewrite a couple of adminhtml controllers in Magento 2. I am using preference and my configuration in etc/di.xml file looks like this: <?xml version="1.0"?> <config xmlns:xsi="http:...
3
votes
0answers
1k views

Reference to undeclared plugin with name 'stockedProductsFilterPlugin' warning in di compile magento 2.3.2

I have recently upgraded my site from Magento 2.2.6 to Magento 2.3.2. During each di compilation it shows a warning like main.INFO: Reference to undeclared plugin with name '...
3
votes
0answers
421 views

Magento 2 setup:di:compile exclude folders [duplicate]

Is it possible to exclude folders for a Magento 2 extension to be able to support Magento 2 compile command? Currently setup:di:compile throws errors that parent classes not found as they are loaded ...
2
votes
1answer
158 views

Magento2: php bin/magento setup:di:compile issue

When I run this command php bin/magento setup:di:compile got the error below: [ReflectionException] Class Magento\Catalog\Model\Product\Link\Resolver does ...
2
votes
1answer
921 views

Magento 2 run setup:di:compile command on a shared hosting with limited memory_limit (max 512M)

I am trying to execute php bin/magento setup:di:compile after enabling a custom module created on my Magento2 store. However, I am using a shared hosting which allows me to set memory_limit upto 512 ...
2
votes
1answer
2k views

Magento 2.2 Build system

I trying to setup build system for setup:di:compile and setup:static-content:deploy based on official devdocs. Build system The build system compiles code and generates static view files for ...
2
votes
2answers
55 views

Magento 2: Command returned non-zero exit code during submission on marketplace

I have submitted a module to the marketplace, I have tested it by all cases. I have switched to production mode but I am not getting any errors. However, I am getting a failure on submission with the ...
2
votes
2answers
170 views

Running setup:di:compile Validation Without doing a Full Compile

Is there a way to run that validations from Magento 2's setup:di:compile without doing a full compile? The setup:di:compile command runs a number of validations on every class file it processes. For ...
2
votes
2answers
4k views

Magento 2 HTTP error 500 on categories after compilation

I am working on a Magento 2.1 website for one of my clients. When running setup:di:compile, my Magento files are successfully compiled without errors. When I open the frontend of my website, my ...
2
votes
2answers
108 views

Is static content ever stored in the di / generated folders?

I'm doing some theme development, which I am somewhat new to. I am making changes to some files, and I like to test if they can compile correctly, so I run the setup:static-content:deploy somewhat ...
2
votes
1answer
1k views

When Compilation and Deployment is required in Magento 2

Its my first project in magento. I am confuse about deployment and compilation. When i do compilation every time after changes i got some error. Also deployment have many more time memory failed and ...
2
votes
2answers
279 views

Why I still need to run setup:di:compile in developer mode?

Quick Intro I'm working on a payment module and using Magento 2.3.2 (irrelevant). As stated in many places, we don't need to run setup:di:compile when in developer mode (which is my scenario). As ...
2
votes
1answer
74 views

Out of memory when compiling Magento 2 - increasing memory doesn't work

When compiling Magento 2, I'm getting the error: Fatal error: Out of memory (allocated 294125568) (tried to allocate 32 bytes) in /vendor/zendframework/zend-code/src/Scanner/FileScanner.php on ...
2
votes
1answer
146 views

How I can solve the di:compile error in Magento 2?

When I run setup:di:compile I got error Errors during compilation: Vendor\CustomRegistration\Model\Customer\DataProvider Incompatible argument type: Required type: bool. Actual type: \Vendor\...
2
votes
0answers
109 views

Magento2: impossible run command in terminal setup:di:compile

Impossible run command: php bin/magento setup:di:compile return error: [@s1 public_html]$ php bin/magento setup:di:compile PHP Fatal error: Uncaught Error: Cannot use object of type ...
2
votes
1answer
283 views

Vertex generation doesn't exist …?

Magento 2.2.4, php7. I' ve been having this error when I try to switch to production and when i try to di:compile; Source class \Vertex for \Vertex\Mapper generation does not exist. No errors in ...
2
votes
0answers
25 views

Magento 2 : Most of the Links are not working after upgrade and compile in magento 2

Most of the Links are not working after upgrade and compile in magento 2.1 Like wish list, Add to Compare, edit/Delete product on cart page, Compare menu etc. Is there any solution ? The href ...
2
votes
0answers
147 views

Ignore specific path when running setup:di:compile in Magento 2.2.2

Is there a additional command to add to setup:di:compile command to ignore a specific path compilation? In Magento 2 this could be done with additional parameter --exclude-pattern, but in Magento 2.2 ...
2
votes
1answer
171 views

Magento Multi-tenant compliation

What exactly is a multi-tenant compiler in Magento as referred in this link: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-compiler.html?
1
vote
4answers
7k views

Blank screen after compiling

After putting the site into production mode and running the compiler, the site just loads a blank white page. I've tried disabling all third party modules and it has not helped. I have all error ...
1
vote
2answers
2k views

Magento 2: Error during compilation

I have below error while running php bin/magento setup:di:compile Errors during compilation: Custom\Module\Block\BuyingListIndex Incorrect dependency in class Custom\Module\...
1
vote
2answers
347 views

When to compile and deploy content

After a year or so of working in Developer Mode, I'm now using Production Mode. As I deploy updates to modules or designs, I'm wondering when I should run the below commands. At the moment, my order ...
1
vote
1answer
2k views

Error compiling Magento2

I have an error during the compilation due to a not completed developed module. As I'm still working on the module I would disable it and continue the compilation. I used to do that on magento1. I ...
1
vote
2answers
127 views

Magento 2.3.2 Developer mode error in setup:di:compile

I am using the Magento 2.3.2 version. When I run the "setup:di:compile" command then Can't remove directory: directory is not empty error occurred. I have also set the permission of the generated ...