Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Required component ExpressionLanguage doesn't throw any exception #25277

Closed
@Aerendir

Description

@Aerendir
Q A
Bug report? yes
Feature request? no
Symfony version 4.0

I'm upgrading an app from SF3.3 to SF4.0.

During the upgrade procedure I've fixed all errors but at certain point I came up simply with a "blank" page with a 500 error.

So I tried to install composer req logger configuring it to log all channels, but in logs nothing were written.

The next step was to install the requirements checker, just to be sure: nothing of relevance. The 500 error was still there.

After some minutes of thoughts I gone with the quick&dirty die(VarDumper::dump('')) way.

In the end I understood that the problem were with some events that triggered some errors somewhere without telling nothing to the browser nor to the logs.

So the next logic step was to run bin/console debug:event-dispatcher and then the error appeared, finally!

19:38:09 CRITICAL [php] Fatal Error: Class 'Symfony\Component\ExpressionLanguage\ExpressionLanguage' not found ["exception" => Symfony\Component\Debug\Exception\FatalErrorException { …}] []
PHP Fatal error: Class 'Symfony\Component\ExpressionLanguage\ExpressionLanguage' not found in /Users/Aerendir/Documents/JooServer/_Projects/MyProject/vendor/symfony/dependency-injection/ExpressionLanguage.php on line 24

So, a simple composer req symfony/expression-language installed the missing component and the "blank" 500 error disappeared.

Now I have another error about a missed template, but this is another story :P

The real thing I want to point out is this:

  1. The ExpressionLanguage component is a required one, so it should be installed by default by the skeleton app;
  2. If you think it isn't required, please, improve the exceptions handling and display a clear message to the developer: I choose Symfony for its clarity: for each thing that doesn't go as expected, there is an error, and any way some breadcrumbs to follow to solve the problem.

In this case, instead, I had to use a lot of my dev experience to solve the problem and understand which it was, and this is not so friendly for a newcomer.

Please, come back to the original philosophy of steep learning curve but with ease.

Anyway, please, require the ExpressionLanguage where required: it took me more than 1 hour to find the problem and less than a minute to solve it once found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions