Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: Blob is not defined #258

Closed
RiccardoRomagnoli opened this issue Mar 24, 2024 · 4 comments
Closed

ReferenceError: Blob is not defined #258

RiccardoRomagnoli opened this issue Mar 24, 2024 · 4 comments

Comments

@RiccardoRomagnoli
Copy link

RiccardoRomagnoli commented Mar 24, 2024

What is the current behavior?

What's happening that seems wrong?

When doing LiveClient.send I get this stack trace:

(node:2656) UnhandledPromiseRejectionWarning: ReferenceError: Blob is not defined
at LiveClient.send (/voicemail/node_modules/@deepgram/sdk/dist/main/packages/LiveClient.js:81:38)
at WebSocket. (file:///voicemail/server.js:87:30)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (/voicemail/node_modules/ws/lib/websocket.js:1209:20)
at Receiver.emit (events.js:314:20)
at /voicemail/node_modules/ws/lib/receiver.js:608:16
at internal/process/task_queues.js:153:7
at AsyncResource.runInAsyncScope (async_hooks.js:189:9)
at AsyncResource.runMicrotask (internal/process/task_queues.js:150:8)
at processTicksAndRejections (internal/process/task_queues.js:97:5)

We want to make sure the problem isn't specific to your operating system or programming language.

  • Operating System/Version: Windows 10
  • Language: node

Other information

My code: deepgramConnection.send(Buffer.from(msg.media.payload, 'base64'));

Fix

I think just importing Blob should be enough since Node.js 16

@lukeocodes
Copy link
Contributor

I believe Blob came at a later version?

@RiccardoRomagnoli
Copy link
Author

https://nodejs.org/docs/latest-v16.x/api/buffer.html#class-blob

I don't see why anyone else still did not encounter this issue with nodejs. I will switch to direct ws connection

@lukeocodes
Copy link
Contributor

Thanks. Off the top of my head, I cannot remember the difference between Blob on 16 Vs 18, but you are not the first person to raise it.

Regardless, the package is pinned at Node 18 because of it

@RiccardoRomagnoli
Copy link
Author

RiccardoRomagnoli commented Mar 24, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants