PHP fatal error when running setup:di:compile

Hello, i have gotten this error the last days and i can’t figure it out. When running setup:di:compile i get this error:

Compilation was started.
Application code generator... 3/8 [=========>----------------]  37% 6 secs 212.0 MiBPHP Fatal error:  Cannot declare class Magento\SomeModule\Model\Proxy, because the name is already in use in /cloudclusters/magento/vendor/magento/framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/Proxy.php on line 8

The magento version is 2.4

In posts on the forum i saw that this could be a memory problem or permission/ownership problem. Since then i have given the server php and .htaccess 4G of memory and followed your instructions to diagnose this by trying to fix ownership/permission errors.

I have gotten to the end of my knowledge and research and can’t fix this.

Here is a screenshot of the problem.

no changes to the SomeModule files have been done.

any help is appreciated.

Thank you in advance,

Use this command
php -d memory_limit=-1 setup:di:compile

thank you very much for your answer. but i still get the same error.

I found the solution to my problem.
which is:

rm -rf vendor/*
composer upgrade
rm -r ./pub/static/frontend/*
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento c:c
php bin/magento c:f

peace :grinning:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.