Open preetpreet opened 1 year ago
i think you should rather do a conditional import/require (parhaps some code splitting or dynamic import just when required) why do you load StreamSaver on a server?
if you can help, your lot thanks could you please more clearification
something like:
if (condition) {
import('something')
.then((something) => {
console.log(something.something);
});
}
Is it working in react js ?? This condition ??
maybe. haven't tried out react if its build process dose support code splitting.
could you please try, otherwise you can add the condition undefiend
You can write your function like this 🤝
const myDownloadFunction = async () => {
const streamSaver = await import("streamsaver")
// OR
const streamSaver = await require("streamsaver")
// Do your fetch or anything
}
could you please add the condition