frenzyapp / turbolinks

Turbolinks is a direct port of the rails turbolinks gem and the jquery.turbolinks gem for projects using the Laravel 4.1+.
MIT License
163 stars 13 forks source link

Class Frenzy\Turbolinks\Middleware\StackTurbolinks does not exist #10

Closed mro95 closed 6 years ago

mro95 commented 8 years ago

I get this error. I use Laravel 5.1 btw.

ReflectionException in Container.php line 741:
Class Frenzy\Turbolinks\Middleware\StackTurbolinks does not exist
in Container.php line 741
at ReflectionClass->__construct('Frenzy\Turbolinks\Middleware\StackTurbolinks') in Container.php line 741
at Container->build('Frenzy\Turbolinks\Middleware\StackTurbolinks', array()) in Container.php line 631
at Container->make('Frenzy\Turbolinks\Middleware\StackTurbolinks', array()) in Application.php line 674
at Application->make('Frenzy\Turbolinks\Middleware\StackTurbolinks') in Pipeline.php line 123
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in TestingWhitelist.php line 46
at TestingWhitelist->handle(object(Request), object(Closure))
at call_user_func_array(array(object(TestingWhitelist), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 23
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 53
InvertedX commented 8 years ago

Same here , i m on laravel 5.3

tortuetorche commented 7 years ago

Hi folks,

Can you update the package with the last version (composer update) and follow the README.md instructions, please?

In particular this section:

Add the Turbolinks middleware, to the $middleware array in app/Http/Kernel.php:

'Frenzy\Turbolinks\Middleware\StackTurbolinks',

Have a good day, Tortue Torche

gavro commented 7 years ago

Make sure you do not use \Frenzy\Turbolinks\Middleware\StackTurbolinks::class in Kernel.php/$middleware. You must use 'Frenzy\Turbolinks\Middleware\StackTurbolinks' as a string in that array.

Why? Take a look at TurbolinksServiceProvider::boot and in specific the bind call there. The class does not exists, it's bound to Helthe\Component\Turbolinks\StackTurbolinks.

tortuetorche commented 6 years ago

I'm going to close this issue, feel free to reopen it if this bug still occurs 😄