Filesaver.js: saveAs is not a function

Created on 21 Mar 2018  路  10Comments  路  Source: eligrey/FileSaver.js

Looks like npm is still pulling 1.3.4 but for some reason FileSaver.saveAs() is causing an error describing saveAs as not being a function. It appears that FileSaver itself is now a function.

Current example:

import FileSaver from 'file-saver';
...
FileSaver.saveAs(new Blob('hello, world', {type: 'text/csv'}), 'Export.csv');

console output

__WEBPACK_IMPORTED_MODULE_10_file_saver___default.a.saveAs is not a function

All 10 comments

Just hit this myself. I had to go back to v1.3.2 for this to work.

Issue related to #414

~We've been targeting ^1.3.4 for at least the past month and it's been working fine. Scratching my head as to what the actual breaking change was, but yeah bad versioning if it was an intentional change.~

Looks like I was wrong, we were on ^1.3.3 which explains the same problem everyone else is having, pinned to 1.3.3 to fix.

1.3.7 patch isn't installing any library. I've hardlocked to 1.3.4 for now.

updated npm library, is it okey now?

just upgraded to 1.3.7. works fine

@kliu99
Can you give the full package.json file and how you are importing saveas. I am also facing same issue.

I'm facing same issue too......

v1.3.7 doesn't work! downgrade

Closing and linking to #414 for tracking of the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

profile4vaibhav picture profile4vaibhav  路  5Comments

sangyeol-kim picture sangyeol-kim  路  5Comments

Toterbiber picture Toterbiber  路  5Comments

binishprabhakar picture binishprabhakar  路  6Comments

meenucoditas picture meenucoditas  路  6Comments