Guard against invalid defines, emit better errors when JS things break.