bee-js icon indicating copy to clipboard operation
bee-js copied to clipboard

`ky` update is required

Open nugaon opened this issue 2 years ago • 12 comments

ky just recently published its new version where they fixed the "The duplex member must be specified for a request with a streaming body" with which we also encountered.

all streaming request are currently affected at the moment in Chrome.

nugaon avatar Sep 05 '22 15:09 nugaon

Thanks for the report. Although in order to update KY, we would have to make Bee-js ES-only which is something that we had not decided to do yet, as it will affect all Bee-js users.

AuHau avatar Sep 05 '22 15:09 AuHau

Btw. Bee-js does not yet uses streaming requests so I'm not sure how it is relevant?

AuHau avatar Sep 05 '22 15:09 AuHau

Fairdrive create account feature is currently broken in Chrome browser. Unless there is a workaround, shim or polyfill, we'd need a fix or upgrade

molekilla avatar Sep 08 '22 13:09 molekilla

Can you please expand on what and how are you using and what does not work? Preferably having reproduction example?

AuHau avatar Sep 08 '22 13:09 AuHau

image_2022-09-08_19-15-22

molekilla avatar Sep 09 '22 11:09 molekilla

@molekilla can you link to the project to a file where this call originates?

It's hard to find the problem if you don't give enough information. I tried to look at the Fairdrive app but it does not even seem to have bee-js as dependency.

agazso avatar Sep 09 '22 12:09 agazso

This https://github.com/fairDataSociety/fdp-storage/blob/c4c08822efd8293e1cbda086d720b3c96551be8b/src/account/account-data.ts#L170

molekilla avatar Sep 09 '22 12:09 molekilla

simple testpage to test out the problem: https://github.com/nugaon/bee-js-issue-762

not only feed/soc update can be affected, but other uploads as well. try it out in Chrome and you will see the same exact problem mentioned before.

nugaon avatar Sep 12 '22 10:09 nugaon

@agazso @nugaon @AuHau https://github.com/sindresorhus/ky/commit/0b141f1725442039a439b683d32d42e9b9d52559

molekilla avatar Sep 12 '22 11:09 molekilla

just update to latest ky-universal version of 0.10.1 (current version is 0.8.2 and is 2 years old) https://github.com/sindresorhus/ky-universal/releases

tfius avatar Sep 12 '22 11:09 tfius

Thanks for the reproduction example. I was able to reproduce it in Chrome.

So first of all to repeat the issue with "just bumping ky" solution that you are proposing. We run the last version of ky that supports CommonJs. Starting 0.26.0 it becomes ESM-only, which means that Ky can't be imported in CommonJS, because of this we have not moved forward with updating it because bee-js would have to become ESM-only as well and force all its users to do so as well. There are for example still environments that don't support ESM like Electron, so we are a bit hesitant about making that switch.

Honestly, this seems like a bug in Chrome, because they are basically making a breaking change from earlier working environments. And there is actually bug report that indicates that they are treating this like that and hopefully they will release fix for this ASAP, because bee-js does not use streaming uploads...

That said, we have discussed this issue today and we are keen on moving towards to the breaking change of migrating to ESM-only as we will have to do it sooner or later, but it won't happen quickly. We need to make sure that we do not break any of our existing products.

Our plan is that we will release a custom bee-js package (under @vaporsphere org) that will be ESM only and will have the updated ky which we will test with our products to make sure everything is alright, and then we will proceed to make the breaking change in bee-js package.

AuHau avatar Sep 14 '22 14:09 AuHau

We have a pre-release out that is ESM-only package and has updated Ky: 6.0.0-pre.0. Can you please try it out and see if that solves your problem?

Btw. after updating puppeteer to latest version which uses the latest Chrome I saw the same problem, and after updating Ky all good.

AuHau avatar Oct 24 '22 13:10 AuHau

Release v5.1.2 addresses this.

bee-worker avatar Feb 03 '23 10:02 bee-worker