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

Unresolvable dependency error when using V8 engine #7

Closed
robinvdvleuten opened this issue Mar 16, 2018 · 7 comments
Closed

Unresolvable dependency error when using V8 engine #7

robinvdvleuten opened this issue Mar 16, 2018 · 7 comments
Labels
bug Something isn't working

Comments

@robinvdvleuten
Copy link

Hi there! When using the V8 engine, I run in the following exception;

Unresolvable dependency resolving [Parameter #0 [ <optional> $object_name ]] in class V8Js

It looks like I can solve the issue by adding;

$this->app->singleton(V8::class, function () {
    return new V8(new \V8Js());
});

But I do not know if that's the "Laravel" way.

@sebastiandedeyne
Copy link
Member

sebastiandedeyne commented Mar 27, 2018

Are you sure the V8Js extension is installed and available?

@robinvdvleuten
Copy link
Author

Yes because when I run it as mentioned in my issue it resolves without errors

@sebastiandedeyne sebastiandedeyne added the bug Something isn't working label Mar 27, 2018
@sebastiandedeyne
Copy link
Member

Hmm didn't come across this myself, odd.

Made some IoC changes though, does the latest release (0.2.4) solve this?

@robinvdvleuten
Copy link
Author

Still getting the error unfortunately with the latest version. Somehow Laravel don't detects that they are optional. Maybe it's an idea to make them configurable?

@sebastiandedeyne
Copy link
Member

Alright, really solved this issue in 0.2.5 using your proposed snippet. Feels like the cleanest way to go :)

@robinvdvleuten
Copy link
Author

@sebastiandedeyne thanks!

@JamesPJ
Copy link

JamesPJ commented Dec 8, 2019

I'm able to reproduce this issue in version ^1.3. To make sure I'm having the v8js installed properly. I've cloned this https://github.com/reactjs/react-php-v8js/tree/master/example example and excecuted it locally. It worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants