-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Web Profiler code not beeing injected properly #42248
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
You are the best! Thank you for testing out unreleased code.
This seams like a separate issue. Im not sure why you experience this. Could you open a new issue with this comment? Maybe even find out where in the code this exception is thrown (or message is created). |
This PR was merged into the 5.4 branch. Discussion ---------- [WebProfilerBundle] Use multi line comment | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #42248 | License | MIT | Doc PR | Since the css/js is "fake minified" (we just remove the new line character) we cannot use `//`. See comment in the head of `base_js.html.twig`: ``` {# Caution: the contents of this file are processed by Twig before loading them as JavaScript source code. Always use '/*' comments instead of '//' comments to avoid impossible-to-debug side-effects #} ``` I also added a small test to enforce this. Commits ------- f7d516e [WebProfilerBundle] Use multi line comment
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 5.4.x-DEV
Description
When openning a page in the dev environment, the web profiler tool isn't showing and there are errors in the browsers console saying Sfjs is not defined and there are sintax errors
Analysis of the generated html reveals that near the end of the first script block there's a comment using // instead of /* */ - and since the code is printed in one line, everything past that comment gets commented out until the closing of the script block
How to reproduce
Create a new project using 5.4.x@dev
composer create-project symfony/website-skeleton:"5.4.x@dev" myproject
Configure a dummy DATABASE_URL in
.env
to overcome the error about not beeing able to connect to the database and create a new controllerbin/console make:controller HomeController
Access the controller via the browser - the profiler isn't shown and there are errors in the console
Possible Solution
Fix the comment to use /* */ instead of //
Additional context
As a side note - 5.4.x has a requirement of PHP >= 7.2.5 set in composer.json but if i try to access it with anything below PHP 8.0.0 I get an error saying it has dependencies that require PHP >= 8.0.0 - shouldn't 5.4.x require PHP >= 8.0.0 in that case?
The text was updated successfully, but these errors were encountered: