I had the same problem. My frontside worked, but the backoffice worked only with debug enabled.
My way to solve this problem:
- I had the UnitOfWork.php error. I read somewhere the recommendation to downgrade from php 7.3 to 7.2. I did so. No result.
- I now got the sensio_framework_extra:router message. I got rid of that. Still no result.
- I downgraded further to php 7.1. Still no result.
- I used Prestools to empty the cache. Now things worked again.