Ts fixes and guards

This fixes the last TS warning
and introduces guard for errors and warnings

if type of build is production
and there will be some errors/warnings 
build will fail

on dev, nothing changes