martinlindhe / laravel-vue-i18n-generator

Generates a vue-i18n compatible include file from your Laravel translations
MIT License
306 stars 207 forks source link

Class vue-i18n.generate does not exist #48

Closed asbiin closed 6 years ago

asbiin commented 6 years ago

From laravel-vue-i18n-generator v0.1.24 and next releases, I get this error:

> @php artisan package:discover
   ReflectionException  : Class vue-i18n.generate does not exist
  at ~/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php: 767
    763|         if ($concrete instanceof Closure) {
    764|             return $concrete($this, $this->getLastParameterOverride());
    765|         }
    766| 
  > 767|         $reflector = new ReflectionClass($concrete);
    768| 
    769|         // If the type is not instantiable, the developer is attempting to resolve
    770|         // an abstract type such as an Interface of Abstract Class and there is
    771|         // no binding registered for the abstractions so we need to bail out.

  Exception trace:

  1   ReflectionClass::__construct("vue-i18n.generate")
      ~/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php : 767

  2   Illuminate\Container\Container::build("vue-i18n.generate")
      ~/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php : 646

  Please use the argument -v to see more details.

Reproductible:

laravel new blog
cd blog
composer require martinlindhe/laravel-vue-i18n-generator

It might be linked to https://github.com/martinlindhe/laravel-vue-i18n-generator/commit/53426829a8fe52e94d2bb9c5bc83776ed9317a81#diff-da4b931def3f8c326a12bcc366148836

martinlindhe commented 6 years ago

Thanks for reporting. A fix coming shortly

martinlindhe commented 6 years ago

Could you please try just released 0.1.27 to see if the fix works correctly?

asbiin commented 6 years ago

Sorry, I have an other error:

> @php artisan package:discover

   Symfony\Component\Debug\Exception\FatalThrowableError  : Type error: Argument 1 passed to Illuminate\Console\Application::add() must be an instance of Symfony\Component\Console\Command\Command, instance of MartinLindhe\VueInternationalizationGenerator\Generator given, called in ~/blog/vendor/laravel/framework/src/Illuminate/Console/Application.php on line 228

  at ~/blog/vendor/laravel/framework/src/Illuminate/Console/Application.php: 200
    196|      *
    197|      * @param  \Symfony\Component\Console\Command\Command  $command
    198|      * @return \Symfony\Component\Console\Command\Command
    199|      */
  > 200|     public function add(SymfonyCommand $command)
    201|     {
    202|         if ($command instanceof Command) {
    203|             $command->setLaravel($this->laravel);
    204|         }

  Exception trace:

  1   Illuminate\Console\Application::add(Object(MartinLindhe\VueInternationalizationGenerator\Generator))
      ~/blog/vendor/laravel/framework/src/Illuminate/Console/Application.php : 228

  2   Illuminate\Console\Application::resolve("vue-i18n.generate")
      ~/blog/vendor/laravel/framework/src/Illuminate/Console/Application.php : 242
martinlindhe commented 6 years ago

I'm really sorry about this. I will revert more.

martinlindhe commented 6 years ago

I screwed up a bit when trying to do some house keeping of the code last night. I have tried to revert the remaining offending parts. Would you please let me know if it works this time around? Version 0.1.28

asbiin commented 6 years ago

Thank you @martinlindhe ! No problem, I completely understand, thank you for your work ! BTW, 0.1.28 version fix the problem. Thanks !