@@ -13,7 +13,7 @@ declare(strict_types=1);
 
 namespace Sonata\MediaBundle\Document;
 
-use Sonata\DatagridBundle\Pager\PagerInterface;
+use Sonata\AdminBundle\Datagrid\PagerInterface;
 use Sonata\Doctrine\Document\BaseDocumentManager;
 use Sonata\MediaBundle\Model\MediaManagerInterface;
 
<?php

declare(strict_types=1);

/*
 * This file is part of the Sonata Project package.
 *
 * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sonata\MediaBundle\Document;

use Sonata\DatagridBundle\Pager\PagerInterface;
use Sonata\Doctrine\Document\BaseDocumentManager;
use Sonata\MediaBundle\Model\MediaManagerInterface;

final class MediaManager extends BaseDocumentManager implements MediaManagerInterface
{
    public function getPager(array $criteria, int $page, int $limit = 10, array $sort = []): PagerInterface
    {
        throw new \BadMethodCallException('Not implemented yet.');
    }
}

This looks wrong. You should use the bundle without the admin stuff