Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when loading provider #240

Closed
cherbst opened this issue Jun 19, 2024 · 1 comment
Closed

Exception when loading provider #240

cherbst opened this issue Jun 19, 2024 · 1 comment

Comments

@cherbst
Copy link

cherbst commented Jun 19, 2024

I use this project in my wordpress plugin using acorn. When the provider is being loaded I get the following exception:

PHP Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Unresolvable dependency resolving [Parameter #1 [ <required> string $manifestPath ]] in class BladeUI\Icons\IconsManifest in <plugin_path>/vendor/illuminate/container/Container.php:1141 Stack trace: #0 <plugin_path>/vendor/illuminate/container/Container.php(1050): Illuminate\Container\Container->unresolvablePrimitive(Object(ReflectionParameter)) #1 <plugin_path>/vendor/illuminate/container/Container.php(981): Illuminate\Container\Container->resolvePrimitive(Object(ReflectionParameter)) #2 <plugin_path>/vendor/illuminate/container/Container.php(943): Illuminate\Container\Container->resolveDependencies(Array) #3 <plugin_path>/vendor/illuminate/container/Container.php(795): Illuminate\Container\Container->build('BladeUI\\Icons\\I...') #4 <plugin_path>/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(957): Illuminate\Container\Container->resolve('BladeUI\\Icons\\I...', Array, true) #5 <plugin_path>/vendor/illuminate/container/Container.php(731): Illuminate\Foundation\Application->resolve('BladeUI\\Icons\\I...', Array) #6 <plugin_path>/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(942): Illuminate\Container\Container->make('BladeUI\\Icons\\I...', Array) #7 <plugin_path>/vendor/illuminate/container/Container.php(1066): Illuminate\Foundation\Application->make('BladeUI\\Icons\\I...') #8 <plugin_path>/vendor/illuminate/container/Container.php(982): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #9 <plugin_path>/vendor/illuminate/container/Container.php(943): Illuminate\Container\Container->resolveDependencies(Array) #10 <plugin_path>/vendor/illuminate/container/Container.php(795): Illuminate\Container\Container->build('BladeUI\\Icons\\F...') #11 <plugin_path>/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(957): Illuminate\Container\Container->resolve('BladeUI\\Icons\\F...', Array, true) #12 <plugin_path>/vendor/illuminate/container/Container.php(731): Illuminate\Foundation\Application->resolve('BladeUI\\Icons\\F...', Array) #13 <plugin_path>/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(942): Illuminate\Container\Container->make('BladeUI\\Icons\\F...', Array) #14 <plugin_path>/vendor/roots/acorn/src/Illuminate/Foundation/helpers.php(120): Illuminate\Foundation\Application->make('BladeUI\\Icons\\F...', Array) #15 /var/www/html/vendor/blade-ui-kit/blade-icons/src/helpers.php(11): app('BladeUI\\Icons\\F...')
I replaced the actual path to our plugin in the logs with <plugin_path>.

The problem seems to be that the container cannot resolve the primitive argument $manifestPath to the IconsManifest class und thus instantiation of the IconsManifest class fails.
It is working if we change the order of register methods in the BladeIconsServiceProvider::register method so that the manifest is registered before the rest of the classes by moving the call to $this->registerManifest() before the call to $this->registerFactory();.
I could provide a PR that does just this if needed.

@driesvints
Copy link
Member

Please resubmit this with a filled out issue template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants