oven-sh / bun

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

Deepgram SDK doesn't work as expected #3986

Open sethgw opened 1 year ago

sethgw commented 1 year ago

What version of Bun is running?

0.7.2

What platform is your computer?

Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

this works:

DEEPGRAM_API_KEY=123 node dg.js

this doesn't work:

DEEPGRAM_API_KEY=123 bun dg.js

dg.js

import pkg from '@deepgram/sdk';
const { Deepgram } = pkg;

const client = new Deepgram(process.env.DEEPGRAM_API_KEY);

const deepgram = client.transcription.live({
  language: 'en',
  punctuate: true,
  smart_format: true,
  model: 'nova',
});

setTimeout(() => {
  if (deepgram.getReadyState() === 1 /* OPEN */) {
    console.log("socket: data sent to deepgram")
    // bun never gets here - error: Unexpected server response: 400
    // node gets here
  }
}, 1500);

What is the expected behavior?

>  DEEPGRAM_API_KEY=123 bun dg.js
> socket: data sent to deepgram

What do you see instead?

>  DEEPGRAM_API_KEY=123 bun dg.js
> error: Unexpected server response: 400

Additional information

sorry, I don't have time ATM to look deeper into this and find the full call stack.

louislva commented 9 months ago

Bump!