-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WebProfilerBundle] /_wdt/styles.css
is not found
#59045
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
On this line:
Replacing So it looks like it's a limitation of the built-in server of PHP. My hypothesis: it tries to find the file |
Possible (ugly) workaround: add this in your template:
|
It looks like it's an edge case, let's see if someone else has the same issue. |
Got this issue too |
Here is a workaround by using the old version to override the new version:
Through CLI: mkdir --parents templates/bundles/WebProfilerBundle/Profiler/
curl https://raw.githubusercontent.com/symfony/symfony/31b6a568850ad260b9d20122667a84ce0665ba7a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig \
--output templates/bundles/WebProfilerBundle/Profiler/toolbar_js.html.twig This will revert this change and inline the CSS instead of loading it through an URL. |
It would be nice to be able to use the "old" way with a parameter of WebProfilerBundle. |
What server do you use? The built-in PHP server too? |
Another workaround: use Symfony CLI to run the server: https://symfony.com/download In the context of PHP in a Docker container, based on an Alpine image:
|
I'm behind docker/nginx. Thanks for your help 👍 |
Issue is (for me) in the nginx vhost:
If I remove css in the regex it's ok. |
Actual solution with PHP's built-in server:- php -S 0.0.0.0:8000 -t public/
+ php -S 0.0.0.0:8000 public/index.php
|
Same issue here, behind NGiNX + PHP-FPM. I get a 404 on Probably caused by
telling NGiNX all |
It works as expected now. @lugosium I didn’t get if you use PHP’s built-in server or something else (like If you use the built-in server, please try the solution on the comment above. Otherwise, please open another issue since it may be related to nginx. |
Adding this to my NGiNX config seems to solve it, though I don't really like having to configure something explicitly for a dev tool.
|
Chaning |
+1 here, suffix |
I reopen this issue so that Symfony's maintainers can study this case. |
This worked for me. Running nginx php-fpm inside Docker. |
I got this issue too, with apache |
Are you all "behind" a proxy and not set |
No proxy for me. |
I encountered this upgrading from 7.1.9 to 7.2.0, the fix from rpkamp worked nicely. |
Another workaround:
I was able to do this in a project, by changing the config instead of the file in
when@dev:
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt
web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler
+ _wdt_stylesheet:
+ path: /custom_wdt/styles
+ controller: web_profiler.controller.profiler::toolbarStylesheetAction It may require to delete the cache. |
same problem with local WAMP Environment on Win11 with standard Apache (no nGinx). Test-Updated from working 7.1.* to 7.3.*, nothing else changed. |
I had the same issue when updating 7.1 to 7.2 |
Solution by @alexislefebvre works perfectly for me
|
I didn't need to do any of that, only the wdt.xml file was enough, and clearing cache. |
The |
The solution that @alexislefebvre suggested is stable and clean, is agnostic to the webserver and doesn't rely on editing vendor files |
I was under the impression both the xml and the routing file needed to be changed. |
Question for people having trouble with this page... is the exception panel stylesheet working ? (it uses the same code as far as i know) /_profiler/123456/exception.css (with a profiler token instead of 123456) |
I'm not sure if that correspond to your question but the profiler and the exception pages are displayed without and with issues: CSS is inlined on this page, it has no display issues: CSS is broken on an exception page: |
My PR had a bad impact on you people and i'm sorry. Sincerely. I'm trying to get all information i can, to find a good solution for everyone (for now: your suggestion to remove ".css" seems the best)
On your first screenshot, we see the profiler token was 970bae (the 6 digits in the URL) Can you try accessing to Thanks |
I encountered a similar problem after updating from 7.1 to 7.2. On my site, the Symfony Toolbar initially appears without a stylesheet and only after a short delay does it display correctly with the stylesheet applied. For me, the only solution that worked was the workaround proposed by alexislefebvre "using the old version to override the new version." Here are some details about my environment: Web server: nginx 1.24.0 (Ubuntu) I’d appreciate any guidance or a permanent fix for this issue. |
This one is permanent: #59045 (comment) Delete the cache with |
Thank you for your response and the suggestion! Unfortunately, clearing the cache with rm -rf var/cache/* doesn't resolve the issue in my case. I’ve already tried this approach several times, but the problem persists. For now, the only solution that reliably works for me is the workaround I mentioned earlier (overriding the new version with the old one). |
There is a PR opened that fixes this problem. Just have to wait for it to be merged. |
…xislefebvre) This PR was merged into the 7.2 branch. Discussion ---------- [WebProfilerBundle] fix loading of toolbar stylesheet | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #59045 | License | MIT It looks like this PR - #58287 Caused issues with some configurations: - #59045 According to the thumb-up emoji on [this comment](#59045 (comment)) (I don’t have a better measurement of the impact), it affected at least 10 users, with various web servers. Proposals: 1. do not use the `.css` file extension so that servers do not try to serve an actual file 2. if we consider that the disappearance of the style of the profiler’s toolbar is a breaking change, the `.css` file extension could be added back with Symfony 8.0, with a note to help people upgrade (see the workarounds in the issue) Commits ------- 7fef930 fix: loading of WebProfilerBundle’s toolbar stylesheet
Symfony version(s) affected
7.2.0
Description
When I browse my local website, the debug toolbar is displayed without any style:
Loading
http://localhost:8000/_wdt/styles.css
in the browser shows:For some reason, it is passed to the PHP built-in server:
How to reproduce
The PHP server runs in Docker through
php -S 0.0.0.0:8000 -t public/
.It looks like it's not the source of the problem since
http://localhost:8000/_wdt/50aa18?XDEBUG_IGNORE=1
works without any issue.Possible Solution
See this workaround to change the path of the path in your project: #59045 (comment)
Additional Context
The debug toolbar has no issues:
Router
config/routes/web_profiler.yaml
debug:router
:Related:
The text was updated successfully, but these errors were encountered: