bufbuild / buf

The best way of working with Protocol Buffers.
https://buf.build
Apache License 2.0
8.5k stars 248 forks source link

Cannot install typescript dependencies with yarn #1719

Open inceenes10 opened 1 year ago

inceenes10 commented 1 year ago

Hi, I am learning buf package manager for a few days and practicing it with nestjs. I have a problem with it.

If I use npm install @buf/openfga_api.grpc_node, package is installed successfully, but with yarn yarn add @buf/openfga_api.grpc_node it gives an error like this

error An unexpected error occurred: "The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined".

I don't understand the error. Help, please.

timostamm commented 1 year ago

Hi Enes, thanks for the report. The error message from yarn really isn't ideal helpful. From our documentation:

Please be aware that Yarn versions greater than v1.10.0 and less than v2 are not supported. These versions of Yarn require the shasum field in the dist object to be set, but the BSR can't compute a digest without generating the code for all possible versions of the package.

We are currently looking into removing this limitation. In the meantime, is it an option for you to switch to a newer version?

inceenes10 commented 1 year ago

Do I have the option to contribute, but I don't really know where to start?

timostamm commented 1 year ago

Thanks for the initiative, Enes! The code for the NPM registry implementation that runs Remote Packages is part of the BSR, which is closed source. It is definitely possible that the BSR will be open source in the future, but it is not currently planned. So we unfortunately cannot accept contributions right now.

Yarn berry makes some very opinionated choices that not everybody might agree with, but staying at v1 doesn't seem to be a great option either, judging from the maintainers note on GitHub:

If you hit bugs or issues with Yarn 1.x, we strongly suggest you migrate to the latest release - at this point they have been maintained longer than 1.x, and many classes of problems have already been addressed there.

bufdev commented 1 year ago

@timostamm is there anything for us to do here?

timostamm commented 1 year ago

@bufdev, we're working on a feature that allows us to provide a hash for the package, which will make yarn v1 work.

Makes sense to me to wait for this feature to land, and close this issue as fixed then, so that users looking at this issue will know.