Skip to content

TypeError: Cannot read properties of undefined (reading 'node') in Cloudflare with AssemblyAI SDK #73

@vricale

Description

@vricale

Description:
When using the AssemblyAI Node SDK in a Cloudflare Worker, I encounter the following error:

TypeError: Cannot read properties of undefined (reading 'node')

Code Snippet:

const { AssemblyAI } = await import('assemblyai');

const client = new AssemblyAI({
  apiKey: getSecret('ASSEMBLY_AI_KEY'),
});

const transcript = await client.transcripts.get(transcriptionId);

Environment:

  • Platform: Cloudflare Workers
  • SDK Version: latest

Steps to Reproduce:

  1. Deploy the above code in a Cloudflare Worker.
  2. Set the ASSEMBLY_AI_KEY secret.
  3. Call the function with a valid transcriptionId.

Expected:
Successfully retrieve the transcript.

Actual:
Error in Cloudflare logs:

TypeError: Cannot read properties of undefined (reading 'node')

Notes:

  • Works correctly in a local Node.js environment.
  • Verified API key and permissions.
  • Tried both CommonJS and ES Module imports without success.

Request:
Assistance in resolving this issue or guidance on using AssemblyAI SDK with Cloudflare Workers.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions