6

I just upgraded my Magento version to the latest Magento version 2.4.0. after a successful upgrade, while I am trying to set production mode I am getting error like

    Compilation was started.
Area configuration aggregation... 5/8 [=================>----------]  62% 34 secs 340.0 MiB
In ClassReader.php line 43:
                                                                      
  Class Magento\Framework\Search\Adapter\Mysql\Mapper does not exist  
                                                                      

In ClassReader.php line 36:
                                                                      
  Class Magento\Framework\Search\Adapter\Mysql\Mapper does not exist  
                                                                      

setup:di:compile

anyone have idea how to fix it. Thanks

3 Answers 3

11

It may be some third-party using these classes in their di.xml files and using those classes as well.

In Magento 2.4, following deprecated classes were deleted.

Magento\Framework\Search\Adapter\Mysql\DocumentFactory
Magento\Framework\Search\Adapter\Mysql\Mapper
Magento\Framework\Search\Adapter\Mysql\ScoreBuilder
Magento\Framework\Search\Adapter\Mysql\Query\Builder\Match
Magento\Framework\Search\Adapter\Mysql\Field\FieldFactory
Magento\Framework\Search\Adapter\Mysql\Aggregation\Builder
Magento\Framework\Search\Adapter\Mysql\Aggregation\DataProviderContainer
Magento\CatalogSearch\Model\Search\TableMapper
Magento\CatalogSearch\Model\Indexer\IndexerHandler
Magento\CatalogSearch\Model\Indexer\ProductFieldset
Magento\CatalogSearch\Model\Indexer\Scope\IndexTableNotExistException
Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator
Magento\CatalogSearch\Model\Adapter\Mysql\Filter\AliasResolver

Use below command to see the those overrides

php bin/magento dev:di:info "Magento\Framework\Search\Adapter\Mysql\Mapper"

Disable/Remove those overrides from the di.xml (Any preference/virtual classes/plugin) its self and delete those overrides file as well otherwise whenever setup:di:compile runs same error will come.

Check Magento doc as well for other classes and interfaces -

https://devdocs.magento.com/guides/v2.4/release-notes/backward-incompatible-changes/index.html

2

Check your catalog search engine configuration. If it's mysql, change to elasticsearch

MySQL catalog search engine is deprecated in Magento 2.4

2
  • its already elasticsearch else site not worked Commented Aug 10, 2020 at 6:10
  • If that is the case, this issue is due to third-party modules incompatibility.
    – Renjith R
    Commented Aug 10, 2020 at 7:56
2

Please check: https://magento.stackexchange.com/a/255080/77121

Go in Magento root:

 find -type f -iname '*.php' -print0 | xargs -0 grep -nw -e 'Magento\\Framework\\Search\\Adapter\\Mysql\\Mapper'

Your Answer

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

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