thiagocordeiro/laravel-translator

Target [Translator\Translator\ConfigLoader] is not instantiable

axtg opened this issue · 14 comments

axtg commented

I'm getting the below output when trying to install this package.
I tried installing another package and then went smooth, upon revert and retrying this package I got the same message again.

Unsure where this comes from.
Hope the output helps identify if anything goes bad.

composer require thiagocordeiro/laravel-translator
Using version ^1.0 for thiagocordeiro/laravel-translator
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   Illuminate\Contracts\Container\BindingResolutionException  : Target [Translator\Translator\ConfigLoader] is not instantiable while building [Translator\Framework\TranslatorCommand, Translator\Translator\TranslationService].

  at E:\Server\www\ratemymeeting.web\vendor\laravel\framework\src\Illuminate\Container\Container.php:979
    975|         } else {
    976|             $message = "Target [$concrete] is not instantiable.";
    977|         }
    978|
  > 979|         throw new BindingResolutionException($message);
    980|     }
    981|
    982|     /**
    983|      * Throw an exception for an unresolvable primitive.

  Exception trace:

  1   Illuminate\Container\Container::notInstantiable("Translator\Translator\ConfigLoader")
      E:\Server\www\ratemymeeting.web\vendor\laravel\framework\src\Illuminate\Container\Container.php:813

  2   Illuminate\Container\Container::build("Translator\Translator\ConfigLoader")
      E:\Server\www\ratemymeeting.web\vendor\laravel\framework\src\Illuminate\Container\Container.php:262

  Please use the argument -v to see more details.
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Installation failed, reverting ./composer.json to its original content.

which Laravel version are you using?

axtg commented

6.5

We just released a new version with a few improvements, our CI integration tests were run on Laravel v6.12.0, could you please try again? try also to clear the cache after installing the package

same problem ,any solution?

which version are you using?

^7.0

any solution?

I will try it out, can you try to manually register the package?

return [
    ...
    'providers' => [
        ...
        Translator\Framework\TranslatorServiceProvider::class,
        ...
    ]
]

The error appears when installing the package ,not after installation

at least on the first comment from @axtg the error happens on php artisan package:discover --ansi which happens after the package is installed

just tried on the newest Laravel version and it works, try to register manually as I mentioned before and please let me know if it works

axtg commented

just tried on the newest Laravel version and it works, try to register manually as I mentioned before and please let me know if it works

Unfortunately for Laravel 6.x it does not yet work. And as Laravel 7 is not a LTS, we're not upgrading. The error message is unchanged when I just ran the composer require command.

@axtg it was developed on Laravel 5, should also work on 6, but just for testing, can you set a new project on the same version and try to install? Also, can you register the provider manually and try it out?

Dear @axtg and @atouiahmed I couldn't find any issue on my install attempts, if you continue having this issue then please provide a repo with the failing code so I can checkout and try.