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
0
votes
2answers
331 views

How can I remotely debug Magento 2 using xdebug when I do not have the “generated” files locally?

I'm already familiar with xdebug, and debugging Magento 1 using it. Now that I'm working with Magento 2, I'm finding that my debugging sessions are failing with error messages like: Cannot find a ...
1
vote
1answer
768 views

magento 2.2.1 setup:di:compile not finished / Fails

I did an upgrade from Magento 2.1.10 to 2.2.1, after some known issues the site is up again. When I run a command setup:di:compile the compilation seems to be broken (see picture below). Also the var/...
6
votes
1answer
5k 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/...
0
votes
1answer
1k 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 ...
4
votes
3answers
3k 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\...
1
vote
1answer
1k 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 ...
11
votes
3answers
25k 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 ...
0
votes
1answer
160 views

Magento 2 : Error during compilation

I encountered an error on running php bin/magento setup:di:compile on CLI Error is : [Zend\Code\Exception\RuntimeException] No tokens were provided How to fix this issue ?
1
vote
0answers
184 views

uncaught error class magento/indexer/model/config/reader

I have been facing this issue since ui upgraded my magento site form 2.0.7 to 2.1.5. When trying to run magento setup:upgarde command to install extension it gives uncaught error class magento/indexer/...
0
votes
1answer
110 views

Technical Review Failed on: deploy:mode:set production

I recently submitted a module to the Magento Marketplace for Technical review; it got rejected with the following error: Command returned non-zero exit code: php -f /var/www/html/bin/magento ...
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 ...
5
votes
3answers
412 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 ...
1
vote
0answers
148 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?
5
votes
3answers
13k 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 ...
1
vote
1answer
474 views

Magento 2: Compile-Multi-Tenant “Not Defined”

My Module reject from Marketplace QA testing. The error they gave was: [ReflectionException] Class \Fanplayr\SmartAndTargeted\Controller\Index\Index does not exist They also let me know test command ...
2
votes
2answers
3k 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 ...
1
vote
1answer
223 views

Magento 2: Di Compile SER Files

When we run php bin/magento setup:di:compile It will generate below files in \magento\var\di folder adminhtml.ser crontab.ser frontend.ser global.ser setup.ser webapi_rest.ser webapi_soap.ser I ...
0
votes
4answers
3k views

Extra parameters passed to parent construct

When I run setup:di:compile command in M2, I got this error in one of my modules. Extra parameters passed to parent construct: $context File name : edit.php Location : /app/code/Vendor/Module/...
0
votes
1answer
342 views

Incorrect dependency error when run setup:di:compile command in magento 2.1.x

I have run command bin/magento setup:di:compile in my Magento 2.1.x. I got below error. Solwin\ProductAttachment\Controller\Adminhtml\Attachment Incorrect dependency in class Solwin\...
0
votes
1answer
50 views

Object instantiations in compiled mode

I was poking around for academic reasons on how the objects are instantiated. I figured out most of the things and the differences between factories (dev, compiled, production) but something scared me....
0
votes
1answer
165 views

When to run magento:setup:compile?

If this question has been answered elsewhere I will delete this one. From a good look around, there doesn't seem to be a solid answer. When I am developing an extension for Magento 2(.1), do I have ...
6
votes
1answer
616 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% ...
1
vote
0answers
460 views

Problem compiling!!! setup-di-compile yields segmentation error Magento 2.1.3

php bin/magento setup:di:compile Compilation was started. Proxies code generation... 0/7 [>---------------------------] 0% 1 sec 18.0 MiProxies code generation... 1/7 [====>--------------------...
1
vote
0answers
544 views

Why does setup:di:compile fail on PHP 7 but not on PHP 5.6?

Running: Ubuntu 16.04 LTS (also happens on Debian Stretch) Magento 2.1.1 PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS ) Magento installed and DB set up etc. I run: rm -rf var/di/* var/generation/* var/...
4
votes
3answers
3k 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/...
0
votes
2answers
7k views

Magento 2: How to remove var/generation folder programatically?

How to remove var/generation folder programmatically. I have used below via command line: sudo rm -rf var/cache var/generation var/di But I want to do it programmatically. Is it possible?
2
votes
2answers
96 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 ...
4
votes
1answer
4k 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\...
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\...
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 ...
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 ...
0
votes
2answers
299 views

setup:di:compile in the different modes

I'm trying to understand how compilation works in Magento 2 with regards to default mode, developer mode, and production mode. The docs state that auto compilation is enabled in developer mode, which ...
1
vote
1answer
457 views

Leverage multi-core CPU in setup:di:compile command Magento 2

When developing for Magento 2 one of the more time consuming system tasks is running bin/magento setup:di:compile. Since the compiler executes several tasks in a queue, I'm thinking executing them ...
2
votes
3answers
6k 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 [>---------------------------] ...
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 ...
8
votes
4answers
3k 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/...
0
votes
2answers
553 views

I run php bin/magento module:enable, page stops loading after that

Fresh install of M2.1 on a Turnkey LAMP (with updated php 5.6 and mysql). I'm trying to test install a 3rd party module, and one of the commands is: <code>php bin/magento module:enable ...
11
votes
1answer
9k 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; ...
3
votes
1answer
857 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
312 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 ...
4
votes
2answers
2k 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/...
5
votes
1answer
3k 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 ...
0
votes
1answer
226 views

Magento 2 - What is the happen when run setup:di:complie

When I run this command: php bin/mangento setup:di:compile It will throw the Error Exception below: [ErrorException] Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\...
1
vote
1answer
2k views

M2 di compiling throws error because of incompatible argument type

I have the following class in Magento 2: namespace Vendor\MyModule\Block; class ProductTab extends \Magento\Catalog\Block\Adminhtml\Category\Tab\Product { /** * @var \Magento\Framework\App\...
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:...
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 ...
2
votes
2answers
165 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 ...