barryvdh / laravel-debugbar

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

Assets doesn't load. #371

Closed Leandro-b-03 closed 8 years ago

Leandro-b-03 commented 9 years ago

Hi, I'm trying to use the debugbar with L5, and the assets doesn't load...

I've read all threads but no one resolve my issue.

So let me explain, when I enter in the route the debugbar assets doesn't load and the console throws me the error:

The stylesheet http://localhost:8000/_debugbar/assets/stylesheets?1436634280 was not loaded because its MIME type, "text/html", is not "text/css".

I refresh the page and the debugbar is there, and load the all assets correctly.

I'm using like that on app.php

    'providers' => [

        /*
         * Development Service Providers...
         */
        Barryvdh\Debugbar\ServiceProvider::class,

        /*
         * Laravel Framework Service Providers...
         */
        Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
        Illuminate\Auth\AuthServiceProvider::class,
        Illuminate\Broadcasting\BroadcastServiceProvider::class,
        Illuminate\Bus\BusServiceProvider::class,
        Illuminate\Cache\CacheServiceProvider::class,
        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
        Illuminate\Routing\ControllerServiceProvider::class,
        Illuminate\Cookie\CookieServiceProvider::class,
        Illuminate\Database\DatabaseServiceProvider::class,
        Illuminate\Encryption\EncryptionServiceProvider::class,
        Illuminate\Filesystem\FilesystemServiceProvider::class,
        Illuminate\Foundation\Providers\FoundationServiceProvider::class,
        Illuminate\Hashing\HashServiceProvider::class,
        Illuminate\Mail\MailServiceProvider::class,
        Illuminate\Pagination\PaginationServiceProvider::class,
        Illuminate\Pipeline\PipelineServiceProvider::class,
        Illuminate\Queue\QueueServiceProvider::class,
        Illuminate\Redis\RedisServiceProvider::class,
        Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
        Illuminate\Session\SessionServiceProvider::class,
        Illuminate\Translation\TranslationServiceProvider::class,
        Illuminate\Validation\ValidationServiceProvider::class,
        Illuminate\View\ViewServiceProvider::class,
        Illuminate\Html\HtmlServiceProvider::class,

        /*
         * Application Service Providers...
         */
        App\Providers\AppServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,

        /*
         * Custom Services Providers...
         */
        Collective\Html\HtmlServiceProvider::class,
        Cviebrock\EloquentSluggable\SluggableServiceProvider::class,
        // Vinkla\Pusher\PusherServiceProvider::class,
        Zizaco\Entrust\EntrustServiceProvider::class,

    ],

I appreciate any help.

vigneshgurusamy commented 9 years ago

+1

lindstrm commented 9 years ago

+1

interludic commented 9 years ago

+1

Leandro-b-03 commented 9 years ago

On my homologation environment (that's online), I'm using the vhost to set the app online and there isn't any problem with the assets, on local environment I start the serve by:

php artisan serve

and it start on localhost:8000, but the address is "::1" here's the console output:

Laravel development server started on http://localhost:8000/

So I've tried to change the host and had no success

Laravel development server started on http://timesheet.localhost.com:80/

[Tue Aug 25 10:13:52 2015] 127.0.0.1:53790 Invalid request (Unexpected EOF)

So at last I tried the vhosts on my machine:

<VirtualHost *:80>
    ServerName timesheet.localhost.com
    DocumentRoot "C:\Users\user\Projetos\Controle-de-Horas/public"
    <Directory "C:\Users\user\Projetos\Controle-de-Horas/public">
        AllowOverride all
    </Directory>
</VirtualHost>

And curiously, worked, but I'm not like using vhosts on local environment, because I'm don't like to apache start together with windows.

After some tries, look like the the php artisan serve --host=timesheet.localhost.com --port=80 worked, but I don't know how it worked, if someone could try to make us understand that behavior on the server I'll be eternally grateful!

PS: I've notice that may it worked after I put the ip and the alias on the hosts like:

127.0.0.1 timesheet.localhost.com

PS2: After restart the app it doesn't work anymore.

najdias commented 8 years ago

Did you check your apache config and changed the Directory www to AllowOverride all?

Leandro-b-03 commented 8 years ago

Well I'm on windows and the vhosts has the AllowOverride all on the directory, but I'm not using apache.

mathieutu commented 8 years ago

+1, and I've nginx, so no AllowOverride possible.. Any solution ?

Leandro-b-03 commented 8 years ago

@mathieutu Man, I even forgot about this topic, but I think I may have a solution.

When I run

php artisan config:cache

The problem disappears until the next view created, may this could help you, is a temporally solution, but works for me.

mathieutu commented 8 years ago

Thank's @Leandro-b-03! It seems to work now, I'll repost here if I've something new.

ager0sa commented 8 years ago

+1 Everything was fine today until I created a new view. Now I have the same error and your fix doesn't work :(

Leandro-b-03 commented 8 years ago

@Neomaltine,

Man, go to bootstrap/cache and delete config.php, see if works. it's a long shot, but could work.

ager0sa commented 8 years ago

@Leandro-b-03 Thank you for the anwer but I started a fresh install and now it's working fine.

Briareos17 commented 5 years ago

I changed route_prefix to "-debugbar" and all starts working fine.