8000 JS TypeError when replacing the debug toolbar · Issue #44142 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

JS TypeError when replacing the debug toolbar #44142

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

Closed
derrabus opened this issue Nov 19, 2021 · 4 comments · Fixed by #44179
Closed

JS TypeError when replacing the debug toolbar #44142

derrabus opened this issue Nov 19, 2021 · 4 comments · Fixed by #44179

Comments

@derrabus
Copy link
Member
derrabus commented Nov 19, 2021

Symfony version(s) affected

5.4.0-BETA3

Description

When replacing the debug toolbar after an AJAX call using the Symfony-Debug-Toolbar-Replace header, a TypeError is logged to the console.

Uncaught TypeError: can't access property "classList", el is null
    removeClass https://localhost:8000/:22
    showToolbar https://localhost:8000/:22
    initToolbar https://localhost:8000/:22
    loadToolbar https://localhost:8000/:22
    load https://localhost:8000/:22
    onreadystatechange https://localhost:8000/:22
    request https://localhost:8000/:22
    load https://localhost:8000/:22
    loadToolbar https://localhost:8000/:22
    finishAjaxRequest https://localhost:8000/:22
    fetch https://localhost:8000/:22
    promise callback*window.fetch https://localhost:8000/:22
    <anonymous> https://localhost:8000/:16
    setTimeout handler* https://localhost:8000/:15
localhost:8000:22:344

How to reproduce

tl;dr: Create a controller that emits the Symfony-Debug-Toolbar-Replace header and perform an AJAX call to that controller.

Long version: use my reproducer that I've published on https://github.com/derrabus/wdt-reproducer

composer install
symfony serve

Then access the / route of the app.

Possible Solution

No response

Additional Context

The problem is gone if I downgrade only symfony/web-profiler-bundle to 5.3.

@derrabus

This comment has been minimized.

@derrabus derrabus reopened this Nov 19, 2021
@derrabus

This comment has been minimized.

@derrabus
Copy link
Member Author

Another side effect is that after the AJAX request the box that appears when hovering over the Symfony versions is cut off.

Before After
Bildschirmfoto 2021-11-19 um 15 13 40 Bildschirmfoto 2021-11-19 um 15 35 08

@derrabus
Copy link
Member Author

If I revert the changes of #41257, the error is gone.

/cc @aleho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0