enter image description here

Class Vendor\Mymodule\Controller\Adminhtml\Allimports\Save\Interceptor does not exist

I have a custom form and when I save data this error message, how to fix it, except usage di: compile. Thank you.


5 Answers 5


Most probably there is an error in your Vendor\Mymodule\Controller\Adminhtml\Allimports\Save class.

Check the constructor for typos or non-existing dependencies.

  • Had a similar issue and it turned out to be a bunch of missing dependencies. Thank you for being the guiding light in this dark and scary world of magento! Mar 15, 2022 at 17:10

If you dont want to go for di compile. Please remove the var/generation folder (For < Magento 2.2) or generated folder (For >= Magento 2.2) and do the deployment, give necessary permissions and check the output.


There might be a chance that you have created a function name and earlier you were not passing any argument in that function. After some changes, you passed one argument to the same function. In this case, an error will come.

So just rename that function name and again run all commands i.e. di:compile. setup:upgrade , s:s:d -f, cache:flush. It will work.

Kudos if this solution work


This might be happening because your class really doesn't exist or because you need to clean up your compiled files and generate them again.

Check if the class exist vendor\Mymodule\Controller\Adminhtml\Allimports\Save

Then run these commands below to make sure you have all your required composer packages installed and you regenerated the compiled files.

   composer install
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento setup:static-content:deploy -f

A similar error happened to me.

I needed to run bin/magento setup:di:compile to get a proper error message, which was a stray comma in a constructor of a totally different class.

So if this happens to you, try running setup:di:compile once to see if any stray compile errors occur.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.