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

Test with Bun and Deno #692

Open
Acconut opened this issue May 28, 2024 · 3 comments
Open

Test with Bun and Deno #692

Acconut opened this issue May 28, 2024 · 3 comments
Assignees

Comments

@Acconut
Copy link
Member

Acconut commented May 28, 2024

In theory, Bun and Deno are somewhat compatible with Node.js runtime. We should test if tus-js-client runs in those environment, and if so, update the documentation and preferable integrate them into our CI setup.

@Acconut Acconut self-assigned this May 28, 2024
@n-kort
Copy link

n-kort commented Jun 17, 2024

I was trying this in Deno (via the Vimeo sdk) and it did not work. No errors or warnings, the files are created but the upload does not proceed (one 'progress' event is fired before it hangs).

Trying it out directly and I got a little further, although I had to use the browser versions for this, and polyfill XMLHttpRequest.

import 'jsr:/@kitsonk/xhr'
import tus from 'npm:tus-js-client/lib.es5/browser/index.js'

Using the test tusdemo endpoint I managed to get it working, with Blob files.

Bun probably should work with the node-specific scripts (Buffer being the main one that doesn't work the same in Deno). I did not try yet though.

@Acconut
Copy link
Member Author

Acconut commented Jun 17, 2024

No errors or warnings, the files are created but the upload does not proceed (one 'progress' event is fired before it hangs).

Interesting, what exactly do you mean by "files are created"? As far as I know, the Vimeo API does not support upload creation via the tus protocol.

Trying it out directly and I got a little further, although I had to use the browser versions for this, and polyfill XMLHttpRequest.

Yes, XMLHttpRequest is not available in Node.js, Bun and Deno. Ideally we would also include a fallback to fetch if that is available instead.

Thank you for reporting!

@Acconut
Copy link
Member Author

Acconut commented Jun 17, 2024

One thing worth mentioning is that the Fetch API does not support upload progress like XHR does: https://stackoverflow.com/questions/35711724/upload-progress-indicators-for-fetch

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

No branches or pull requests

2 participants