fromSafeConstant throws exception in dev mode