I'm using "file-saver": "^1.3.4", "@angular/cli": "1.6.7", and Angular 5.
Following the documentation usage:
import {saveAs} from 'file-saver';
const blob = new Blob(results, {type: "text/plain;charset=utf-8"});
saveAs(blob, 'file.db');
I'm getting the error:
ERROR TypeError: Object(...) is not a function
EDIT: I noticed that the issue is related to version 1.3.4. After downgrading to 1.3.3 I'm now able to download the file.
+1
I can confirm the same issue.
see #414
In v1.3.4, the syntax changed. You will need to do
import FileSaver from "file-saver"
FileSaver(blob, "filename.pdf")
Thank, you, for your response, but I think, it should be considered as breaking change, therefore the version should change properly.
Most helpful comment
Thank, you, for your response, but I think, it should be considered as breaking change, therefore the version should change properly.