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

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

Open
vricale opened this issue Jan 9, 2025 · 0 comments

Comments

@vricale
Copy link

vricale commented Jan 9, 2025

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!

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

1 participant