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

Target [League\Fractal\ScopeFactoryInterface] is not instantiable while building [Dingo\Api\Transformer\Adapter\Fractal, League\Fractal\Manager] #1636

Closed
gruz opened this issue Mar 18, 2019 · 5 comments
Assignees

Comments

@gruz
Copy link

gruz commented Mar 18, 2019

Q A
Bug? no
New Feature? no
Framework Laravel
Framework version 5.8.4
Package version 2.1.0
PHP version 7.2.4

Actual Behaviour

After starting debug mode (xdebug) in my VSCode an exception is thrown after performing any dingo request. It doesn't seem to affect any behavior, but annoys when trying to debug the code.

./laravel/framework/src/Illuminate/Container/Container.php:962

Exception has occurred.
Illuminate\Contracts\Container\BindingResolutionException: Target [League\Fractal\ScopeFactoryInterface] is not instantiable while building [Dingo\Api\Transformer\Adapter\Fractal, League\Fractal\Manager].

If you are not running the debug mode you will not see the error at all.

Expected Behaviour

No exception is thrown

Possible Solutions

I can solve it by adding to my AppServiceProvider

    public function register()
    {
        $this->app->bind("League\\Fractal\\ScopeFactoryInterface", "\\League\\Fractal\\ScopeFactory");
        //
    }
}

Possibly related to #1584

@specialtactics
Copy link
Member

Hi @gruz thanks for reporting.

Is this a new or existing project? If existing, what changes occurred to begin manifesting this error?

@specialtactics specialtactics self-assigned this Mar 18, 2019
@gruz
Copy link
Author

gruz commented Mar 18, 2019

@specialtactics
Existing project. Too many changes to describe.

It has laravel-tenancy, Voyager, custom-coded laravel-tenancy+Voyager integrations, Dingo + Passport. Auto-discovery disabled for Voyager in favor of manual provider loading.

@specialtactics
Copy link
Member

Ok @gruz , I guess in that case it seems like it's probably to do with the integrations of your project (in fact I am very surprised you have all those things working together !!).

If it's not easy to replicate on a new project, probably there is not much to be done, best I can do is document your solution in the wiki in a known issues section perhaps?

@gruz
Copy link
Author

gruz commented Mar 18, 2019

I can do is document your solution in the wiki in a known issues section perhaps?

Ok.

@specialtactics
Copy link
Member

Thanks for your help

Documented here: https://github.com/dingo/api/wiki/Known-Issues

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

No branches or pull requests

2 participants