oven-sh / bun

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

Respond handling issue for Most of Google Cloud API (vision, document, etc.) #7925

Open pjerryhu opened 10 months ago

pjerryhu commented 10 months ago

What version of Bun is running?

1.0.7+b0393fba6200d8573f3433fb0af258a0e33ac157

What platform is your computer?

Darwin 22.3.0 arm64 arm

What steps can reproduce the bug?

The most simple google vision api example would just hang at line await client.textDetection(fileName);:

const vision = require('@google-cloud/vision');

// Creates a client
const client = new vision.ImageAnnotatorClient();

/**
 * TODO(developer): Uncomment the following line before running the sample.
 */
// const fileName = 'Local image file, e.g. /path/to/image.png';

// Performs text detection on the local file
const [result] = await client.textDetection(fileName);
const detections = result.textAnnotations;
console.log('Text:');
detections.forEach(text => console.log(text));

ref: https://cloud.google.com/vision/docs/ocr#vision_text_detection-nodejs

What is the expected behavior?

it should return the correct ocr result.

What do you see instead?

program just stopped at IO

Additional information

I can use tsc && node .../index.js to run script successfully. But bun runtime would hang

Jarred-Sumner commented 10 months ago

Can you try on bun v1.0.20? bun upgrade

we’ve made many improvements since bun v1.0.7

pjerryhu commented 10 months ago

Hi @Jarred-Sumner , I tried with v1.0.20. The problem is still there

danew commented 4 months ago

I'm also encountering this issue on v1.1.17