Open mirusu400 opened 2 years ago
It gets error when import FileSaver dynamically
FileSaver
(async() => { const FileSaverSrc = "./FileSaver.js"; const FileSaverLib = await import(FileSaverSrc); var blob = new Blob(["Hello, world!"], { type: "text/plain;charset=utf-8" }); saveAs(blob, "hello world.txt"); })();
Just remove or make comment 11st line.
(function (global, factory) { if (typeof define === "function" && define.amd) { define([], factory); } else if (typeof exports !== "undefined") { factory(); } else { var mod = { exports: {} }; factory(); // global.FileSaver = mod.exports; <- remove this line !! } })(this, function () {
Here is my test repo. https://github.com/mirusu400/FileSaver-Issue
What's wrong?
It gets error when import
FileSaver
dynamicallyTemporary solution
Just remove or make comment 11st line.
Test repo
Here is my test repo. https://github.com/mirusu400/FileSaver-Issue