document is a global variable. It causes the build to fail. It whould be replaced by Aria.$window.document