fruitcake / laravel-telescope-toolbar

A toolbar for Laravel Telescope, based on the Symfony Web Profiler.
MIT License
778 stars 39 forks source link

Toolbar doesn't work with browsersync #51

Open lichtner opened 3 years ago

lichtner commented 3 years ago

I would like to use laravel-telescope-toolbar with browserSync

Toolbar works fine with php artisan serve on http://localhost:3000

But after I enabled browserSync in webpack.mix.js:

.browserSync({
    proxy: 'http://localhost:8000',
    files: [
        'resources/views/**/*.blade.php',
    ]
});

on domain http://localhost:8000 I don't see any toolbar and in Chrome console I see this error:

Access to XMLHttpRequest at 'http://localhost:8000/_tt/render/92872b43-05f7-4ed3-807c-39f62ba9a9f8' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

btw. telescope works on both domains http://localhost:8000/telescope http://localhost:3000/telescope

I am not sure if it a bug or can you help me how can I fix it? Thanks

muhzak commented 3 years ago

In your cors.php add _tt/*

    'paths' => [
            'api/*',

            '_tt/*',
    ],