Open Schachte opened 2 years ago
I have never used Cloudflare Workers, so my knowledge is limited. However, it seems that they implement a limited set of browser-like APIs (such as WebSocket, Web Crypto, Fetch etc) but not a full browser environment. Hence window
is not defined.
So it seems as if tus-js-client is currently not compatible with Cloudflare Workers, but I think it would be possible to achieve support for that. Two things need to be changed at least:
All in all, tus-js-client could run on Workers. Let me know if you are interested in helping with the above points. I don't have enough time to work on them on my own, but I am more than willing to assist you.
Hey @Acconut , apologies for the late response. Thanks for the detailed reply! Once I get a bit of time, I can circle back to this and try and throw up a PR.
@Schachte Great to hear back from you! Let me know if you need further assistance!
Has there been any work on this since?
There has been no further progress since. Would you be interested in submitting a PR for this?
Describe the bug I'm attempting to leverage tus for large file uploads using Cloudflare Workers. Simply running
const tus = require("tus-js-client")
yieldswindow is not defined
.I've tried various hacks like defining window in global scope to an empty object, trying conditional importing, but I can't seem to get around this. Any suggestions?
These yield the same result