nWidart / laravel-modules

Module Management In Laravel
https://docs.laravelmodules.com
MIT License
5.49k stars 951 forks source link

Target class [cache] does not exist. #1529

Closed lukas-frey closed 1 year ago

lukas-frey commented 1 year ago

When installing the package filament-modules (https://github.com/savannabits/filament-modules) inside that plugin's config for this line 'path' => module_path($moduleName, "$contextPath/Pages"),

it shows the following error:

   Illuminate\Contracts\Container\BindingResolutionException 

  Target class [cache] does not exist.

  at vendor/laravel/framework/src/Illuminate/Container/Container.php:891
    887▕ 
    888▕         try {
    889▕             $reflector = new ReflectionClass($concrete);
    890▕         } catch (ReflectionException $e) {
  ➜ 891▕             throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
    892▕         }
    893▕ 
    894▕         // If the type is not instantiable, the developer is attempting to resolve
    895▕         // an abstract type such as an Interface or Abstract Class and there is

  1   [internal]:0
      Nwidart\Modules\FileRepository::__construct(Object(Illuminate\Foundation\Application))

      +8 vendor frames 
  10  [internal]:0
      Nwidart\Modules\FileRepository::__construct(Object(Illuminate\Foundation\Application))

It seems like it's more of a laravel-modules issue than an error with the other package itself.

javierhstr commented 1 year ago

Hi, any solution?

lukas-frey commented 1 year ago

You can temporarily fix it by replacing all module_path calls inside the config files with a base_path call. The error is somewhere inside the module_path function.

javierhstr commented 1 year ago

yes, I had already tried it, but I thought it could be something else. thanks!

leek commented 1 year ago

Would love to see a fix for this...

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mstfkhazaal commented 1 year ago

any solutions?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

hoangnamitc commented 1 year ago

How to fix it?

problem same when call

image
siadress commented 3 weeks ago

any solutions?