Comments (12)
my local server runs on port 8900 and I installed laravel in /testl
The normal thing is to configure a virtual host to avoid these kind problems
<VirtualHost *:8900>
DocumentRoot "C:\laravel\testl\public"
ServerName laravel.localhost
Header set Access-Control-Allow-Credential true
<Directory "C:\laravel\testl\public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
So, your url is like http://laravel.localhost
laradock/laradock/apache2/sites/sample.conf.example
from laravel-debugbar.
Same problem from me, when I upgrade to Laravel 11.
The "normal thing" with a virtual host is not a solution, when you have (per exemple) multiples apps laravel on the same server (like testing git branchs individually from a test server) .
And Laravel can be deploy behind a subfolder.
from laravel-debugbar.
Can you try dev-master?
from laravel-debugbar.
Maybe related to #1562
On this case i think #1555 is a better option
from laravel-debugbar.
my local server runs on port 8900 and I installed laravel in /testl
The normal thing is to configure a virtual host to avoid these kind problems
<VirtualHost *:8900> DocumentRoot "C:\laravel\testl\public" ServerName laravel.localhost Header set Access-Control-Allow-Credential true <Directory "C:\laravel\testl\public"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost>So, your url is like
http://laravel.localhost
laradock/laradock/apache2/sites/sample.conf.example
I agree... using a vhost and pointing some fake domain to it in the /etc/hosts file would have been easy, but due to some circumstances outside my control, my current setup is locked down and I can't do that.
For now I downgraded to version 3.10, which loads the debug bar's assets correctly regardless of url.
from laravel-debugbar.
Same issue here still on Laravel 10.x (latest 10.x so far). It seems to be due to #1562 which forces relative URLs somehow? I'm not sure.
FWIW, my laravel app/website is on a subdirectory on the apache server, and APP_URL
is correctly set in the .env
file.
In fact, the routes get correctly set up for the proper subdirectory if I try going to the javascript one manually in the browser, for instance, but it's the injected html to load js/css that's missing the app_url part.
For now, I've just forced the usage of the 3.10.6 release.
from laravel-debugbar.
Something like this in JavascriptRenderer.php should solve the issue:
$cssRoute = route('debugbar.assets.css', [
'v' => $this->getModifiedTime('css'),
'theme' => config('debugbar.theme', 'auto'),
]);
$jsRoute = route('debugbar.assets.js', [
'v' => $this->getModifiedTime('js')
]);
$cssRoute = parse_url($cssRoute, PHP_URL_PATH);
$jsRoute = parse_url($jsRoute, PHP_URL_PATH);
The issue started when someone requested that the domain name part be removed in addition to the http/https part.
I think it's better to just build the complete url and remove the http/https + domain parts, keeping the whole relative path. This should make it work regardless if laravel is hosted in some subdirectory or not. Setting $absolute to false in the "route" helper cuts too deep - it removes the whole APP_URL string.
from laravel-debugbar.
Thanks @alexmocanu
I was just about to try to copy the change in #1555 when I realised that my source file was a later version including #1562 and therefore the code didn't match. I have tried your suggested change to JavascriptRenderer.php instead and it seems to have fixed the problem. My console errors have disappeared and the debugbar is showing. I hope your suggestion has no unwanted side-effects and can become a fix.
from laravel-debugbar.
parse_url($cssRoute, PHP_URL_PATH);
cuts the query part, #1555 is a better option
from laravel-debugbar.
Has this been patched?
It seems to still happen on the installation I did about 5 hours ago...
from laravel-debugbar.
@barryvdh working like a charm. Thank you!
from laravel-debugbar.
@barryvdh dev-master works for me as well. (laravel 11)
from laravel-debugbar.
Related Issues (20)
- Debugbar crashing application with out of memory exception HOT 3
- Unable to disable debugbar when app.debug is true HOT 2
- Debugbar crashing in applications with Inertia installed on requests that do not use Inertia HOT 10
- Undefined array key "file" HOT 3
- Argument #1 ($string) must be of type string, Illuminate\Database\Events\QueryExecuted given HOT 1
- Is FilesCollector still needed? HOT 1
- Exceptions After Installing on OctoberCMS HOT 3
- [Feature]: Support multiple logging channels
- Livewire 3 & SPA Mode: "Maximum call stack size exceeded" HOT 11
- DebugBarException "'mail' is not a registered collector" on 3.11.0 HOT 3
- Debugbar info/alert/warning not showing in controller POST method call. HOT 2
- Fix editor link to Livewire components (e.g. when they are used for routes) HOT 1
- Question about the dataset switcher HOT 3
- Suggestions for slight UI tweaks. HOT 2
- DebugBar not visible after upgrading to Laravel 11 HOT 2
- Queries with union and uses wrong binding parameters (in some cases) HOT 4
- Suggestion for additional styling of the request history tab content
- Laravel flash messages not working after update to 3.13 HOT 7
- TypeError: data.__meta is undefined HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-debugbar.