'Doctrine - Undefined clas const JSON_ARRAY

I got this message error: On stack trace I cant find the file that produces it. I'm using symfony 5 and doctrine.

Undefinied class constant 'JSON_ARRAY'

I search in all project for JSON_ARRAY with out results.

Stack Trace:

Stack Trace - 1 Stack Trace - 2 Stack Trace - 3 Stack Trace - 4



Solution 1:[1]

I find it was an update on composer json file that produce that error. After looked for a solution I find that symfony got an update that produces that error on the new versions. My solution was going to last checkpoint I did for composer json file.

Solution 2:[2]

I had this issue because I was using Symfony 5.2 and doctrine/dbal 3.

The thing is Symfony 5.2 is only compatible with doctrine/dbal 2.

So I set dbal to v2:

$ composer require doctrine/dbal:^2
$ composer install

Then everything worked fine ?

Issue: https://github.com/symfony/symfony/pull/43994

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 jawira