oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.25k stars 2.69k forks source link

Bun process exits silently when downloading GCS files with @google-cloud/storage #7747

Open Scalahansolo opened 9 months ago

Scalahansolo commented 9 months ago

What version of Bun is running?

1.0.18

What platform is your computer?

Darwin 23.0.0 arm64 arm

What steps can reproduce the bug?

As pointed out in this thread. (https://github.com/oven-sh/bun/issues/6200#issuecomment-1857250127)

This can reproed with a setup similar to the code in https://github.com/oven-sh/bun/issues/6200#issuecomment-1858461497.

Bun will list files in GCS just fine. Downloading files however does not work at all. Whenever I've attempted to download files in various ways using this npm library, the process just exits with code 0. I've also tried to use bun inspect with no success. In ever setup I've tried the process just exits with 0.

What is the expected behavior?

I'd expect to be able to use Bun along with @google-cloud/storage to download files from GCS

What do you see instead?

No response

Additional information

If it were possible to setup a shareable repro, I would, but I think since this involves using a GCP json key it's not easy to provide a super simple repro. I could maybe put together a repo with steps for setting up a GCS account that shows this issue?

Scalahansolo commented 9 months ago

To just provide some proof of what I am seeing, here some screenshots of my code and how it executes. This bun command ultimately calls the code block seen here.

CleanShot 2023-12-19 at 14 24 06@2x

CleanShot 2023-12-19 at 14 20 59@2x

gusfune commented 8 months ago

I have a similar issue with @google-cloud/storage, but in my case is saving a file to a bucket. I've managed to track down the issue to a dependency:

TypeError: null is not an object
      at node:1:8827
      at parseKeys (node:1:8847)
      at sign (node:1:8983)
      at node:1:9127
      at sign (/usr/src/app/node_modules/jwa/index.js:152:45)
      at jwsSign (/usr/src/app/node_modules/jws/lib/sign-stream.js:32:24)
      at /usr/src/app/node_modules/gtoken/build/src/index.js:224:31
      at requestToken (/usr/src/app/node_modules/gtoken/build/src/index.js:212:26)
      at getTokenAsyncInner (/usr/src/app/node_modules/gtoken/build/src/index.js:143:30)
      at /usr/src/app/node_modules/gtoken/build/src/index.js:137:55