What version of this package are you using?
0.107.16
What operating system, Node.js, and npm version?
Mac OS 10.14.6 / Chrome 77.0.3865.90 or Safari 13 / Node 12.0.0 / npm 6.11.3
What happened?
On browser, when I call the seed method using a W3C File input, "end-of-stream" is throwing an error :
error Error: premature close
at onclosenexttick (webtorrent.min.js:12485)
at Item.run (webtorrent.min.js:3160)
at drainQueue (webtorrent.min.js:3130)
It adds the torrent in the WebTorrent client but the torrent.files === [] and torrent.done === false.
If I put the 1.4.1 end-of-stream package, there is no problem.
What did you expect to happen?
And the torrent.files should contain the input data and torrent.done should be true.
Yep. Thanks for notifying this @Evoks.
Looks like end-of-stream has added some incompatible changes in the last versions. Related end-of-stream#11
Is there any plan for this issue to be solved? Is there a known workaround to make the most minimal upload functionality work at least? All examples and documentation for uploading a file are broken out of the box using the latest release versions. Always "premature close" in the console after a short delay.
EDIT: The occasional rare file will consistently work correctly, but it seems unpredictable which files are working. This behavior can be observed on instant.io using Chromium 70.
@umbra-scientia Webtorrent just requires ^1.1.0 so what I ended up doing was explicitly requiring [email protected] in my dependencies, and that solved the problem for me. Hope it helps
@umbra-scientia Webtorrent just requires ^1.1.0 so what I ended up doing was explicitly requiring [email protected] in my dependencies, and that solved the problem for me. Hope it helps
This workaround does not work anymore. Have a look at my solution here https://github.com/webtorrent/instant.io/issues/210#issuecomment-609687048
@alxhotel @KayleePop This issue is blocking uploads on instant.io and has crippled usability for the past several months. Is there a way that this can be assigned some sort of higher priority label?
@DeltaF1 I second that. This issue is driving people away from even considering the package. I almost gave up when I saw that the npm package did not work and neither did the online tool/example. I spent hours trying to debug the problem and I do not believe every user is ready to do that.
instant.io is working for me right now. can you try it again?
I just tested again on FF 75. Still getting "premature close"
EDIT: I attempted to upload a .mp4 file if that helps, by the "drag 'n' drop" method
@KayleePop no, it is not working. If I remember correctly it will work only with a few types of file. Try with a .webm or a .pdf for example, just tried those and they do not work.
yeah, works on my laptop but not my phone for some reason.
I don't have any control over instant.io, but here's a version on glitch.com that uses these PRs (that eliminate multistream as a dependency) https://github.com/webtorrent/create-torrent/pull/115, and https://github.com/webtorrent/webtorrent/pull/1832.
Nothing else is changed from the instant.io master branch except pulling those PRs from github for webtorrent and create-torrent
I also tried with just the create-torrent PR, so pinning end of stream in webtorrent seems to work.
I confirm that the same files that caused the error on instant.io are uploading just fine in the version you posted.
I'm using [email protected] and I also experienced this issue.
Just verified that the npm i [email protected] workaround fixes it on the browser.
Thanks for reporting it @Evoks 馃檶
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
It seems as if this issue has been fixed in the latest version since we pinned to end-of-stream 1.4.1. Can this be closed now?
I'm still getting Filesharing [error:"Error: premature close on latest version of webtorent (0.110.1) which is using end-of-stream 1.4.1
@feross As the issue persists still, please take a look at this PR #1832 which eliminates the need for buggy dependencies!
Most helpful comment
@umbra-scientia Webtorrent just requires ^1.1.0 so what I ended up doing was explicitly requiring [email protected] in my dependencies, and that solved the problem for me. Hope it helps