Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document undefined issue #301

Open
preetpreet opened this issue Jan 16, 2023 · 7 comments
Open

Document undefined issue #301

preetpreet opened this issue Jan 16, 2023 · 7 comments

Comments

@preetpreet
Copy link

image (46)

could you please add the condition

@jimmywarting
Copy link
Owner

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?

@preetpreet
Copy link
Author

preetpreet commented Jan 16, 2023

if you can help, your lot thanks
could you please more clearification

@jimmywarting
Copy link
Owner

something like:

if (condition) {
    import('something')
    .then((something) => {
       console.log(something.something);
    });
}

@preetpreet
Copy link
Author

Is it working in react js ?? This condition ??

@jimmywarting
Copy link
Owner

maybe. haven't tried out react if its build process dose support code splitting.

@preetpreet
Copy link
Author

could you please try, otherwise you can add the condition undefiend

@hsoulier
Copy link

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
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants