Thank you for reporting this issue.
This problem makes me curious. util is something that is "always" defined. On any code path in my testing (setting stage, data stage (all three substages) and runtime, the 'util' object is defined. But in your scenario, it is not. This should never be the case, but apparently that is possible.
Did you do anything special / do you have some special mod loaded? What version of factorio is that? Space Age or regular? Does it happen when you load a game or right after activating the module?
Do you have a save file that shows this that you can share?