symfony: Update to 4.2.7 - Fatal error: Interface 'TranslatorInterface' not found

Symfony version(s) affected: 4.2.7

Description
After my composer update from 4.2.6 to 4.2.7 I get the following fatal error.

Fatal error: Interface 'Symfony\Component\Translation\TranslatorInterface' not found 
in testarea_symfony_api\vendor\symfony\validator\Util\LegacyTranslatorProxy.php
 on line 21

In LegacyTranslatorProxy.php line 21:

  Attempted to load interface "TranslatorInterface" from namespace "Symfony\Component\Translation".
  Did you forget a "use" statement for "Symfony\Contracts\Translation\TranslatorInterface"?

How to reproduce

Upgrade from 4.2.6 to 4.2.7 via composer update.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 29
  • Comments: 23 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Mailbox spammed by thousands of “same error” mails won’t help them to fix it up. 😉

composer req symfony/translation

same error

does anyone have a solution for this? update seems fine, but i´m getting this problem when trying to issue php bin/console doctrine:cache:clear

https://github.com/symfony/symfony/pull/31108#issuecomment-484184993

temporary add to requirements “symfony/translation”: “4.2.*”, to fix this

Thanks @Gemorroj for providing this workaround. I’ll have a look tomorrow, unless someone submits a PR meanwhile.

@Spomky @stof Or use the cweagans/composer-patches package to patch it for you before they release it.

Then in composer.json:

{
  "extra": {
    "patches": {
      "symfony/framework-bundle": {
        "Fix translator": "https://github.com/symfony/framework-bundle/commit/9c3f47e28e0ea66b762b99a8573d6d7acaa43244.patch"
      }
    }
  }
}

So the idea to solve that issue is to require something we don’t need… Prefer not to do that and wait for a better solution.

Something like this can help: https://github.com/TomaszGasior/RadioLista-v3/commit/1c8170df7f027e29ba7d9c5f9145e93a31aca590

Until new release of framework-bundle you need to fork framework-bundle repository and create your own branch for commit with bugfix.

Or you can just install translator component. 😉

Same error here

@featuriz You can do that for the moment as a workaround until the fix from #31156 is released with Symfony 4.2.8.

the other solution is to install the dev version of FrameworkBundle, which already contains the patch, which will be part of the 4.2.8 release.

Same error. For the moment we go back to version 4.2.6.

same error