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 throw on a fresh installation of laravel & dingo-api #1584

Closed
karamqubsi opened this issue Aug 30, 2018 · 5 comments
Closed

Exception throw on a fresh installation of laravel & dingo-api #1584

karamqubsi opened this issue Aug 30, 2018 · 5 comments

Comments

@karamqubsi
Copy link

Q A
Bug? maybe
New Feature? no
Framework Laravel
Framework version 5.6.35
Package version v2.0.0-alpha1
PHP version 7.2.9

Actual Behaviour

Exception is thrown after performing any php artisan command while in debug mode in a fresh laravel with dingo setup.

Expected Behaviour

There should be no exceptions

Steps to Reproduce

After installing fresh Laravel then adding Dingo package then starting debug mode in my VSCode an exception is thrown after performing any php artisan command ,
Example : php artisan serve ( with debug mode )
will give
PHP Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [League\Fractal\ScopeFactoryInterface] is not instantiable while building [Dingo\Api\Transformer\Adapter\Fractal, League\Fractal\Manager]. in /laravel/testapi/vendor/laravel/framework/src/Illuminate/Container/Container.php:933

if you are not running the debug mode you will not see the error at all , but I guess this might be affecting some other behaviour (I'm not sure ) for example when trying to generate documentation I'm getting empty file with only titles so I tried to debug there and I encountered this issue but I'm not sure what are side effects of it .

@karamqubsi karamqubsi changed the title Exception throw on a fresh installation of laravel & dingo Exception throw on a fresh installation of laravel & dingo-api Aug 30, 2018
@Jzhuonan
Copy link

Jzhuonan commented Sep 2, 2018

Try this:

  1. Add minimum-stability and prefer-stable in composer.json file
.
.
.
"config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
"minimum-stability" : "dev",
"prefer-stable" : true
  1. Install the latest version
composer require dingo/api:2.0.0-alpha2

@karamqubsi
Copy link
Author

Hi thanks , yes the debugger still stoping there with that error message.

... ScopeFactoryInterface] is not instantiable ...

@specialtactics
Copy link
Member

specialtactics commented Sep 26, 2018

Can be closed, the package just needs to be tagged (as there's been many fixes lately). @thilanga

@gruz
Copy link

gruz commented Mar 16, 2019

I get this problem with Digno 2.1.0
But my Laravel+Dingo is far from being a fresh install.
How can I debug the issue?

For now I've fixed it by adding to my AppServiceProvider

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

@specialtactics
Copy link
Member

Can you please submit a new issue if it's a problem @gruz

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

4 participants