4

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...'

Vishwas Bhatnagar
4,7193 gold badges39 silver badges61 bronze badges
asked Jul 18, 2022 at 10:34

5 Answers 5

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

enter image description here

answered Jul 19, 2022 at 8:59
3

I found the issue , It was in my extension where there was space after \ in constructor.

answered Jul 18, 2022 at 10:44
0

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;
answered Oct 11, 2022 at 11:28
0

I get this error in my custom extension when ; (semicolon) was missing.

answered Nov 4, 2022 at 12:52
0

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

answered Mar 16, 2023 at 12:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.