support browserify, where require can return null