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

Navin Bhudiya
  • 2,988
  • 9
  • 37
  • 69

3 Answers3

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

sandip
  • 4,004
  • 2
  • 24
  • 56
2

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

MySQL catalog search engine is deprecated in Magento 2.4

Renjith R
  • 273
  • 1
  • 2
  • 11
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'
Materix
  • 468
  • 5
  • 14