If you're using Visual Studio Code or another IDE.
Try to check if some of your plugins have conflicts with the code. For example, I got that problem with PHP IntelliPhense's plugin.
Maybe that will work.