Closed vorvex closed 3 months ago
Your Node.js runtime may be lower than 18. Node.js introduced Fetch natively since 18, which is the lowest version we support in the AssemblyAI SDK. 18 is also the lowest version supported by Node.js themselves, as older versions have fallen out of support.
I'm not sure what version of Node.js is configured on your Firebase Cloud Function, but I would look around in the configuration and see if you can update it.
Alternatively, you could use a package like node-fetch and add the fetch
as a global variable.
Thank you for the response. Seems it was still using version 16.
Hello there,
I get the following error running assembly on a firebase cloud function:
ReferenceError: fetch is not defined at TranscriptService.fetch (/workspace/node_modules/assemblyai/dist/node.cjs:85:26) at TranscriptService.fetchJson (/workspace/node_modules/assemblyai/dist/node.cjs:105:37) at TranscriptService.submit (/workspace/node_modules/assemblyai/dist/node.cjs:500:33) at TranscriptService.transcribe (/workspace/node_modules/assemblyai/dist/node.cjs:462:39)
This is my CODE
` import { AssemblyAI, TranscriptUtterance } from 'assemblyai';
`
Thanks in Advance