Exporting error and empty .js file