Filesaver.js: saveAs return empty function

Created on 6 Jan 2019  路  7Comments  路  Source: eligrey/FileSaver.js

Hi,

I add file saver in the head tag, as follow

<script src="~/Scripts/FileSaver.min.js"></script>

And in my javascript just try to call following line of code

saveAs(new Blob([buffer], { type: "application/octet-stream" }), "test.xlsx");

and nothing works. I try to console.log(saveAs) it return empty function. It happen for release2.0. For release1.3.8 this issue does not occuer

Most helpful comment

@Ruffio my problem is that I'm using Ecma 6 import syntax instead of require, and that gives the error presented at 2.0.0

All 7 comments

I have the exact same issue, an empty function is being exported from 2.0.0 now. I call it and nothing happens, no errors either. I believe it worked before, because I remember having tested this. Rolling back to 1.3.8 indeed fixed it.

Please read the documentation of how to use FileSaver:

image

@azhaziqgoh Has your issue been resolved and can be closed?

@Ruffio my problem is that I'm using Ecma 6 import syntax instead of require, and that gives the error presented at 2.0.0

Why is the ECMA6 import syntax not supported?

This problem appears fixed in 2.0.1 to me.

Seems fixed already. Closing this

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rhyous picture rhyous  路  6Comments

Toterbiber picture Toterbiber  路  5Comments

mluis picture mluis  路  3Comments

danielbronder picture danielbronder  路  6Comments

carlosEdua picture carlosEdua  路  3Comments