Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export command #445

Closed
ramblerswebs opened this issue May 29, 2018 · 1 comment
Closed

Export command #445

ramblerswebs opened this issue May 29, 2018 · 1 comment

Comments

@ramblerswebs
Copy link

I am a newbie to JS so this is probably a stupid question, but any help would be greatly appreciated
I am using version 1.3.8
I have copied the zip across to my PC and in my html I have a link to the FileSave.js file (from src folder)
When I view this file in Netbeans it gives an error on the export in line 16 and the return line a few statements down.
If I run the code Firefox 60.0.1 gives the error
SyntaxError: export declarations may only appear at top level of a module FileSaver.js:16:1

So I tried deleting the export (as I noticed this is not in the minified file used in the demos)
This removes the error two msgs. But I now have to access FileSaver.saveAs(blob, "hello world.txt");
with saveAs(blob, "hello world.txt");

This now seems to work but some browsers now tell me the download did not complete.

Any help gratefully received.

@sffc
Copy link

sffc commented Aug 2, 2018

FileSaver.js uses exports syntax that not all browsers support. As a workaround, either use an old version of FileSaver.js, or set up your build system to use a tool like Babel to convert FileSaver.js to an older ECMAScript version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants