cancel
Showing results for 
Search instead for 
Did you mean: 

Magento compilation error

SOLVED

Magento compilation error

Hello,

 

Im trying to change my magento mode to production but compilation fails. When I run the compilation command this is what I got:

> bin/magento setup:di:compile
Compilation was started.
Interceptors generation... 4/7 [================>-----------]  57% 16 secs 196.0 MiBMiB0.0 MiB
                                       
  [InvalidArgumentException]                                     
  Plugin class Vendor\Module\Plugin\WysiwygConfig doesn't exist  
                                                                 
setup:di:compile

Don't understand what's going on. Also I tried to change mode with the --skip-compilation parameter and it works fine but some parts of the page stop working, like the extension 'slider revolution'. 

 

It seems that nobody has the same error than me. What can I do to solve it?

 

Thank you very much.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento compilation error

Yes do setup upgrade first by running this command : php bin/magento setup:upgrade

 

and then run above mention command like : php bin/Magento setup:di:compile then cache clean and cache flush.

 

no if the line you have posted is in this module only - then error is coming from here only !!

 

 

if issue solved,Click Kudos & Accept as Solution

View solution in original post

9 REPLIES 9

Re: Magento compilation error

Could you give me which file contains this class 

 Vendor\Module\Plugin\WysiwygConfig

Also Share code of above WysiwygConfig Class file.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: Magento compilation error

Hi, thanks for the reply.

 

Im not sure but I think the file that is searching is this:

/vendor/magento/module-cms/Model/Wysiwyg/Config.php

Tell me if I'm wrong and where I should search it.

 

I didn't change this file at all so I don't know if you really want the code.

 

Re: Magento compilation error

You need to check in your app/code directory.

 

Where you will find your custom/third party module.

 

issue coming from there only - so find below line of code : in your app/code directory and post here which file contains this code.

class Vendor\Module\Plugin\WysiwygConfig

 

if issue solved,Click Kudos & Accept as Solution

Re: Magento compilation error

Hi and thanks again,

 

This what I found on app/code:

app/code/Talv/WysiwygFix/Plugin/WysiwygConfig.php:5:class WysiwygConfig

<?php

namespace Talv\WysiwygFix\Plugin;

class WysiwygConfig
{
    public function afterGetConfig($subject, \Magento\Framework\DataObject $config)
    {
     	$config->addData([
            'add_directives' => true,
        ]);

	return $config;
    }
}

Is that what causes this problem?

Re: Magento compilation error

Yes error is coming from this module only - app/code/Talv/WysiwygFix

 

So as of now disable this module by running below command :

 

php bin/magento module:disable Talv_WysiwygFix

 

You can also disable this module from app/etc/config.php by making this module value is - from 1 to 0(zero)

 

then after run below commands : 

 

php bin/magento setup:di:compile
php bin/magento cache:clean
php bin/magento cache:flush

It will works !!

if issue solved,Click Kudos & Accept as Solution

Re: Magento compilation error

Hi,

 

I disabled it but when I execute the compile command it stills fails with the same error. I cleaned the cache and give it the permission but still got the same error.

 

Maybe I have to do an upgrade first? or the problem is caused by another module?

 

Thank you for your support.

Re: Magento compilation error

Yes do setup upgrade first by running this command : php bin/magento setup:upgrade

 

and then run above mention command like : php bin/Magento setup:di:compile then cache clean and cache flush.

 

no if the line you have posted is in this module only - then error is coming from here only !!

 

 

if issue solved,Click Kudos & Accept as Solution

Re: Magento compilation error

Hi,

 

Sorry I was just not seeing that our custom plugin had a call to that as well...

 

It works now! Thank you very much!

Re: Magento compilation error

Glad to know that you have resolved your issue , Happy to help and keep helping Smiley Happy

 

if issue solved,Click Kudos & Accept as Solution