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.


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.


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

Check the constructor for typos or non-existing dependencies.


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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