Hi I am getting the below error while upgrading Magento 2.3.4 to 2.4.4
MiBsyntax error, unexpected token "", expecting variable#0 /var/www/html/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/html/v...'
5 Answers 5
I faced a similar issue so I tracked it back to below class and added a echo statement. The last class shown in the output was having a extra comma in the constructor.
Class /vendor/composer/ClassLoader.php Line 428
I found the issue , It was in my extension where there was space after \ in constructor.
In my case, there is new line after ResourceModel\ in the following path
/app/code/Company/MpVendorRegistration/Block/Adminhtml/Group/Edit/Tab/Attributes.php
the code was like bellow
use Company\MpVendorRegistration\Model\ResourceModel\
 VendorRegistrationAssignGroup\CollectionFactory as VendorRegistrationAssignGroupCollection;
use Company\MpVendorRegistration\Model\ResourceModel\
 VendorRegistrationAttribute\CollectionFactory as VendorRegistrationAttributeCollection;
It must be like bellow code
use Company\MpVendorRegistration\Model\ResourceModel\VendorRegistrationAssignGroup\CollectionFactory as VendorRegistrationAssignGroupCollection;
use Company\MpVendorRegistration\Model\ResourceModel\VendorRegistrationAttribute\CollectionFactory as VendorRegistrationAttributeCollection;
 I get this error in my custom extension when ; (semicolon) was missing.
Try to run command using php version like:
/usr/bin/php8.1 bin/magento setup:di: compile
Instead of php bin/magento setup:di:compile