2

Please any one can help on this issue facing after upgradation to 2.4.5

Fatal error: Uncaught Error: Class "Magento\Framework\Component\ComponentRegistrar" not found in /home/project/public_html/project/app/code/Pstk/Paystack/registration.php:
    2 Stack trace: #0 /home/project/public_html/project/app/etc/NonComposerComponentRegistration.php(29): require_once() #1 [internal function]: Magento\NonComposerComponentRegistration\{closure}('/home/project/...') #2 /home/project/public_html/project/app/etc/NonComposerComponentRegistration.php(29): array_map(Object(Closure), Array)
#3 /home/project/public_html/project/app/etc/NonComposerComponentRegistration.php(33): Magento\NonComposerComponentRegistration\{closure}() #4 /home/project/public_html/project/vendor/composer/autoload_real.php(78): require('/home/project/...') #5 /home/project/public_html/project/vendor/composer/autoload_real.php(61):
composerRequire7c076114c1fc19108a2bae029c92d3d7('b4cf39431a4b949...', '/home/project/...') #6 /home/project/public_html/ilechv1/vendor/autoload.php(7): ComposerAutoloaderInit7c076114c1fc19108a2bae029c92d3d7::getLoader() #7 /home/project/public_html/project/app/autoload.php(30): include('/home/ilecyqfu/...') #8 /home/project/public_html/
ilechv1/app/bootstrap.php(33): require_once('/home/project/...') #9 /home/project/public_html/project/index.php(23): require('/home/project/...') 
#10 {main} thrown in /home/project/public_html/project/app/code/Pstk/Paystack/registration.php on line 2

Magento_Bhurio
  • 940
  • 5
  • 14

1 Answers1

0

Firstly, check if your code in app/code/Pstk/Paystack/registration.php is correct.

If that file is correct, let's run the following commands:

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

If you still facing this issue, looks like your upgrade from magento 2.3.4 to 2.4.5 failed, try the following solutions:

Solution 1: Update the composer.json file specifically the require-dev section with what is written here https://github.com/magento/magento2/blob/2.4.5/composer.json

Then remove vendor folder and run the following commands:

composer install
bin/magento setup:upgrade
bin/magento setup:di:compile

Solution2: Do the following steps:

  1. STAY IN PHP 7.3
  2. composer require magento/composer-root-update-plugin ~2.0 --no-update
  3. composer update
  4. rm -rf var/cache/* var/page_cache/* generated/code/* ; bin/magento setup:upgrade
  5. composer require-commerce magento/product-community-edition 2.4.5 --no-update
  6. composer update
  7. CHANGE TO PHP 8.1
  8. rm -rf var/cache/* var/page_cache/* generated/code/* ; bin/magento setup:upgrade; bin/magento setup:di:compile

Reference: https://github.com/magento/magento2/issues/35306

Tu Van
  • 6,868
  • 2
  • 11
  • 22