barryvdh / laravel-debugbar

Debugbar for Laravel (Integrates PHP Debug Bar)
MIT License
17.49k stars 1.56k forks source link

After install not displaying - Laravel 9 #1297

Open AiFxApp opened 2 years ago

AiFxApp commented 2 years ago

"laravel/framework": "^9.0", "php": "^8.0.2", "livewire/livewire": "^2.10", Breeze.

I always and forever have used barryvdh/laravel-debugbar with no issues ever.

I went the standard route of installing as per GITHUB REPO as i have done on countless projects.

This time the debug bar does not display.

I have run every possible *:clear / autodump CMD without success?

Please advice - Thank you.

image

hopkins385 commented 2 years ago

as per documentation:

the Debugbar will be enabled when APP_DEBUG is true.

Is in your .env file APP_DEBUG=true ?

toby1kenobi commented 2 years ago

I seem to have this too (having used debugbar easily before) - Windows 10, Laravel 9, PHP8.1, APP_DEBUG=true, clearing everything I can but can't get debugbar to appear

AiFxApp commented 2 years ago

as per documentation:

the Debugbar will be enabled when APP_DEBUG is true.

Is in your .env file APP_DEBUG=true ?

Yes, as I have mentioned.. I use this in all my projects with success.

1st : I install the debug bar, as per repo guide 2nd: .env => APP_DEBUG=true 3rd: refresh browser - and there it is 🙂

Please note, this only seems to occur on that specific project ??? Every other install is working.. so o copied the code (painful) into a new framework.. and all is well.

Thank you for your reply, sorry I didn't reply sooner.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.

Wall0fDeath commented 2 years ago

HI! I have an Aimeos shop installation ( the standalone version ). I installed this package and I set the .env variables as it was mentioned.

After restart, browser reopen, refresh, dump autoload I still can't see the debug bar.

I had simple laravel project without the Aimeos. It worked with that. ( But that was Laravel 8 not 9 as it is in the Aimeos project )

Any idea?

joelconty commented 2 years ago

This is happening to me too. I have been using it for many years. Just cant get it to work on Laravel 9. Laravel Version ........................................................................................................................... 9.22.1
PHP Version ................................................................................................................................ 8.1.8
Composer Version ........................................................................................................................... 2.3.3
Environment ................................................................................................................................ local
Debug Mode ............................................................................................................................... ENABLED

Wall0fDeath-Mithrandir commented 2 years ago

I used Aimeos with Laravel 9 and it seems the debugbar had a problem with the CSP. It didn't show images and it blocked many inline scripts and the debugbar too.

I changed this default in the copy of base.blade.php:

<meta http-equiv="Content-Security-Policy" content="base-uri 'self'; default-src 'self' 'nonce-{{ app( 'aimeos.context' )->get()->nonce() }}'; {{ config( 'shop.csp.frontend', 'style-src \'unsafe-inline\' \'self\'; img-src \'self\' data: https://aimeos.org; frame-src https://www.youtube.com https://player.vimeo.com' ) }}">

To this for test:

<meta http-equiv="Content-Security-Policy" content="default-src *; font-src * data:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data:">

Everything started to work for me, even the debugbar.

This is not a solution, just a hint to where to start. Everyone must write his own CSP handling, this just removes most of the restrictions. :))

Have a nice day!

joelconty commented 2 years ago

For those who might be interested, I discovered what was my issue: In my routes/api.php I had a line for deactivating debugbar in my api endpoints, like this: \Debugbar::disable(); Up to laravel 8 this was fine.. It did not affect anything outside my api routes. But that changed in Laravel 9. So all i had to do in my routes/api.php was put the debugbar disable line inside the functions i had there , like this: Route::get('foo/bar', function(){ \Debugbar::disable(); return ApiController::getFoo(); });

mgw2007 commented 2 years ago

hi I had same issue and the solution for my case is create folder storage/debugbar and give it permissions after I create this folder the toolbar appear thanks

luckydonald commented 2 years ago

Also note that it may not show up due to CSP_ENABLED=true. Setting it to false (not recommended) did fix it for me.

ciceromatias commented 2 years ago

After install and config the extension, try it:

php artisan optimize

andrewvaca commented 2 years ago

Hi, I've just experience this same strange behavior - debugbar was not visible on local env after fresh install and after one hour of trying every advice I could find I find out it was blocked by Brave's (browser's) anti-trancking shield. I dunno why it was blocked. I just want to share this to maybe save someone some time in future :)

beataburczyk commented 2 years ago

After install and config the extension, try it:

php artisan optimize

This solution also works for me, for listed below components: "laravel/framework": "^9.2", "laravel/octane": "^1.2", "livewire/livewire": "^2.10", "barryvdh/laravel-debugbar": "^3.7",

gabriuss commented 1 year ago

After install and config the extension, try it:

php artisan optimize

None of the solutions worked for me, this one did. Thank you.

nafiesl commented 1 year ago

hi I had same issue and the solution for my case is create folder storage/debugbar and give it permissions after I create this folder the toolbar appear thanks

I had this issue on laravel 10 and this solution works for me, thanks @mgw2007

makowskid commented 1 year ago

After recent changes in the Debugbar package you need to set

`DEBUGBAR_ENABLED=true`

inside your .env file