I have installed Magento 2 B2B module via composer. after install, I tried to create the new user in the frontend. But I got the below error.

Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Company\Model\Customer\Company\Interceptor::createCompany() must be of the type array, string given, called in /app/vendor/magento/module-company/Model/Plugin/AccountManagement.php on line 119 and defined in /app/generated/code/Magento/Company/Model/Customer/Company/Interceptor.php:20 Stack trace: #0 /app/vendor/magento/module-company/Model/Plugin/AccountManagement.php(119): Magento\Company\Model\Customer\Company\Interceptor->createCompany(Object(Magento\Customer\Model\Data\Customer), 'kmgkumar', NULL) #1 /app/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Company\Model\Plugin\AccountManagement->afterCreateAccount(Object(Magento\Customer\Model\AccountManagement\Interceptor), Object(Magento\Customer\Model\Data\Customer), Object(Magento\Customer\Model\Data\Customer), 'admin@123', 'https://b2bmodu...') #2 /app/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Customer\Model\AccountManagement\Interceptor->Magento\Framework\Int in /app/generated/code/Magento/Company/Model/Customer/Company/Interceptor.php on line 20

I was facing same issue, and resolved by following this: https://community.magento.com/t5/Magento-2-x-Technical-Issues/M2-2-1-Order-details-bug/td-p/93280

You have issue of Factory classes/Method. to resolve the issue kindly follow the below steps :

rm -rf  var/generation
rm -rf generated
rm -rf var/cache
rm -rf var/page_cache
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush
  • But I used a Magento cloud environment. I can't able to do the compilation process.
    – kmg kumar
    Jan 28 '19 at 11:15
  • Which cloud environment you are working on? AWS or google or something else? Jan 28 '19 at 11:17
  • Every cloud environment give shell access, and you need to run di compile and deploy command in order to run magento2. This is most important part in magento2 Jan 28 '19 at 11:20

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.