omines / datatables-bundle

DataTables bundle for Symfony
https://omines.github.io/datatables-bundle/
MIT License
255 stars 114 forks source link

Updated dependency to fix Symfony/contracts issue. #138

Closed Raistlfiren closed 4 years ago

Raistlfiren commented 4 years ago

Good evening,

I ran into the following error when attempting to deploy my project to PROD:

Warning: Ambiguous class resolution, "Symfony\Contracts\Translation\LocaleAwareInterface" was found in both "/vendor/symfony/translation-contracts/LocaleAwareInterface.php" and "/vendor/symfony/contracts/Translation/LocaleAwareInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\Translation\TranslatorTrait" was found in both "/vendor/symfony/translation-contracts/TranslatorTrait.php" and "/vendor/symfony/contracts/Translation/TranslatorTrait.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\Translation\TranslatorInterface" was found in both "/vendor/symfony/translation-contracts/TranslatorInterface.php" and "/vendor/symfony/contracts/Translation/TranslatorInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\Service\ServiceSubscriberTrait" was found in both "/vendor/symfony/service-contracts/ServiceSubscriberTrait.php" and "/vendor/symfony/contracts/Service/ServiceSubscriberTrait.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\Service\ServiceProviderInterface" was found in both "/vendor/symfony/service-contracts/ServiceProviderInterface.php" and "/vendor/symfony/contracts/Service/ServiceProviderInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\Service\ServiceSubscriberInterface" was found in both "/vendor/symfony/service-contracts/ServiceSubscriberInterface.php" and "/vendor/symfony/contracts/Service/ServiceSubscriberInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\Service\ResetInterface" was found in both "/vendor/symfony/service-contracts/ResetInterface.php" and "/vendor/symfony/contracts/Service/ResetInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\Service\ServiceLocatorTrait" was found in both "/vendor/symfony/service-contracts/ServiceLocatorTrait.php" and "/vendor/symfony/contracts/Service/ServiceLocatorTrait.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\HttpClient\ResponseStreamInterface" was found in both "/vendor/symfony/http-client-contracts/ResponseStreamInterface.php" and "/vendor/symfony/contracts/HttpClient/ResponseStreamInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\HttpClient\ChunkInterface" was found in both "/vendor/symfony/http-client-contracts/ChunkInterface.php" and "/vendor/symfony/contracts/HttpClient/ChunkInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\HttpClient\HttpClientInterface" was found in both "/vendor/symfony/http-client-contracts/HttpClientInterface.php" and "/vendor/symfony/contracts/HttpClient/HttpClientInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface" was found in both "/vendor/symfony/http-client-contracts/Exception/ServerExceptionInterface.php" and "/vendor/symfony/contracts/HttpClient/Exception/ServerExceptionInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\HttpClient\Exception\ExceptionInterface" was found in both "/vendor/symfony/http-client-contracts/Exception/ExceptionInterface.php" and "/vendor/symfony/contracts/HttpClient/Exception/ExceptionInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface" was found in both "/vendor/symfony/http-client-contracts/Exception/ClientExceptionInterface.php" and "/vendor/symfony/contracts/HttpClient/Exception/ClientExceptionInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface" was found in both "/vendor/symfony/http-client-contracts/Exception/TransportExceptionInterface.php" and "/vendor/symfony/contracts/HttpClient/Exception/TransportExceptionInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface" was found in both "/vendor/symfony/http-client-contracts/Exception/RedirectionExceptionInterface.php" and "/vendor/symfony/contracts/HttpClient/Exception/RedirectionExceptionInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface" was found in both "/vendor/symfony/http-client-contracts/Exception/HttpExceptionInterface.php" and "/vendor/symfony/contracts/HttpClient/Exception/HttpExceptionInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\HttpClient\ResponseInterface" was found in both "/vendor/symfony/http-client-contracts/ResponseInterface.php" and "/vendor/symfony/contracts/HttpClient/ResponseInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\EventDispatcher\Event" was found in both "/vendor/symfony/event-dispatcher-contracts/Event.php" and "/vendor/symfony/contracts/EventDispatcher/Event.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\EventDispatcher\EventDispatcherInterface" was found in both "/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php" and "/vendor/symfony/contracts/EventDispatcher/EventDispatcherInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\Cache\ItemInterface" was found in both "/vendor/symfony/cache-contracts/ItemInterface.php" and "/vendor/symfony/contracts/Cache/ItemInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\Cache\CacheTrait" was found in both "/vendor/symfony/cache-contracts/CacheTrait.php" and "/vendor/symfony/contracts/Cache/CacheTrait.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\Cache\CallbackInterface" was found in both "/vendor/symfony/cache-contracts/CallbackInterface.php" and "/vendor/symfony/contracts/Cache/CallbackInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\Cache\CacheInterface" was found in both "/vendor/symfony/cache-contracts/CacheInterface.php" and "/vendor/symfony/contracts/Cache/CacheInterface.php", the first will be used. Warning: Ambiguous class resolution, "Symfony\Contracts\Cache\TagAwareCacheInterface" was found in both "/vendor/symfony/cache-contracts/TagAwareCacheInterface.php" and "/vendor/symfony/contracts/Cache/TagAwareCacheInterface.php", the first will be used.

After Googling the issue it seems like the problem lies with the symfony/contracts dependency. It should actually be symfony/translation-contracts.

Thanks!

curry684 commented 4 years ago

This is not a fix, as symfony/translations already depends on those contracts. We have symfony/contracts as a dependency for the real loose bound contracts, specifically the Event Dispatcher.

The error you have is technically impossible, as symfony/contracts explicitly indicates that it replaces symfony/translation-contracts, so both cannot be installed at the same time.

I would recommend:

  1. Upgrade your Composer to the latest version
  2. rm -rf vendor
  3. composer update