You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, when an exception gets thrown during rendering, EntrypointLookup doesn't get reset. If your page and the error page extend the same base template and use the same css/js, the error page won't get the tags that got rendered before the exception. I ran into this when trying to use an un-initialized paginator without a correct DB setup.
Simplest reproduction setup I can think of:
Make the error pages extend your base template (create the templates/bundles/TwigBundle/Exception/error.html.twig file). Put the error in the body/content block.
Render the base template in a controller.
Add encore_entry_link_tags to your head section and add it again with an invalid entry name in the body/content block.
Open the page in prod environment so that the error page renders.
I'm sure a lot of people have error pages set up like this, because it's a quick and easy way to make them not look horrible. A workaround for this is resetting the EntrypointLookup in an exception listener. If that's an OK solution for you guys as well, I can create a PR with that.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Basically, when an exception gets thrown during rendering, EntrypointLookup doesn't get reset. If your page and the error page extend the same base template and use the same css/js, the error page won't get the tags that got rendered before the exception. I ran into this when trying to use an un-initialized paginator without a correct DB setup.
Simplest reproduction setup I can think of:
templates/bundles/TwigBundle/Exception/error.html.twig
file). Put the error in the body/content block.prod
environment so that the error page renders.I'm sure a lot of people have error pages set up like this, because it's a quick and easy way to make them not look horrible. A workaround for this is resetting the EntrypointLookup in an exception listener. If that's an OK solution for you guys as well, I can create a PR with that.
The text was updated successfully, but these errors were encountered: