Skip to content

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

@gruz

Description

@gruz
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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions