YasserSE
12/18/2025, 12:50 PMAI Evy
12/18/2025, 12:50 PMAI Evy
12/18/2025, 12:51 PMAI Evy
12/18/2025, 12:51 PMAI Evy
12/18/2025, 12:51 PMaddSources endpoint has had intermittent issues. [(1) ]() One user reported that Retell confirmed it was fixed after experiencing similar 400/500 errors.
Recommended approach: Use the official SDK rather than direct REST API calls. Here's the correct SDK usage:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
async function main() {
const knowledgeBaseResponse = await client.knowledgeBase.addSources({
knowledge_base_texts: [
{
text: "Hello, how are you?",
title: "Sample Question",
},
],
knowledge_base_urls: [
"<https://www.retellai.com%22,>
"<https://docs.retellai.com%22,>
],
knowledge_base_files: [
fs.createReadStream("../sample.txt") ,
],
}) ;
console.log(knowledgeBaseResponse.knowledge_base_id) ;
}
main() ;
[(2) ]()
If you're still experiencing issues:
1. Confirm your knowledge base exists and note its status using the retrieve endpoint [(3) ]()
2. Ensure you're passing the knowledge_base_id as a path parameter [(2) ]()
3. The Knowledge Base API for create/add only works for the SDK now [(1) ]()
Workaround: If addSources continues to fail, creating a new knowledge base with knowledgeBase.create() works reliably.
If the issue persists, reach out to support at [Contact Sales]() or check [) .YasserSE
12/18/2025, 12:54 PMAI Evy
12/18/2025, 12:54 PMAI Evy
12/18/2025, 12:54 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
[(1) ]() , [(2) ]()
Common causes of this error:
1. Using CommonJS require() syntax instead of ES module import
2. Incorrect default import handling in your bundler configuration
3. Missing or outdated retell-sdk package
Steps to resolve:
1. Ensure you're using the ES module import syntax shown above [(1) ]()
2. Verify the SDK is installed: npm install retell-sdk
3. Check that your project supports ES modules (Node.js 18.10.0+ is required)
If you're in a CommonJS environment and cannot use ES imports, you may need to adjust your bundler configuration or use dynamic imports.AI Evy
12/18/2025, 12:54 PMAI Evy
12/18/2025, 12:54 PMYasserSE
12/18/2025, 12:56 PMAI Evy
12/18/2025, 12:56 PMAI Evy
12/18/2025, 12:56 PMCannot read properties of undefined (reading 'default')) indicates a module resolution issue with the Retell SDK in your Next.js RSC (React Server Components) environment.
Known Issue: There's a reported compatibility problem with Turbopack in Next.js 15.2 and the Retell SDK. [(1) ]()
Recommended workaround: Use Next.js 14 for now. The Retell team is still working to fix this.
If you must use Next.js 15:
1. Disable Turbopack by running next dev without the --turbo flag
2. Ensure you're using the correct import syntax:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
[(2) ]() , [(3) ]()
3. For environments where the global fetch needs to be used instead of node-fetch, add this import before your Retell import:
javascript
import 'retell-sdk/shims/web';
import Retell from 'retell-sdk';
Requirements: Node.js 18.10.0 or higher is required for the Node.js SDK. [(2) ]()
If the issue persists after disabling Turbopack, reach out via [Contact Sales]() or check [) .AI Evy
12/18/2025, 12:56 PMAI Evy
12/18/2025, 12:57 PMYasserSE
12/18/2025, 1:30 PMAI Evy
12/18/2025, 1:30 PMAI Evy
12/18/2025, 1:31 PMRetellClass is not a constructor error indicates the SDK module isn't being resolved correctly in your Next.js RSC environment. This is a known bundler/module resolution issue.
The correct import and initialization:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
[(1) ]() , [(2) ]()
Key things to try:
1. Add the web shims import before your Retell import if you're in an environment that needs the global web fetch:
javascript
import 'retell-sdk/shims/web';
import Retell from 'retell-sdk';
2. Verify Node.js version — the SDK requires Node.js 18.10.0 or higher [(1) ]()
3. The retell-sdk is a server-side library — it should not be used in client-side React code. Ensure your lib/retell-kb.ts file is only running in server contexts (which RSC should be, but double-check your bundler config) . [(3) ]()
4. Disable Turbopack if you're using Next.js 15+ with --turbo flag, as there are known compatibility issues.
If none of these resolve it, the issue may be specific to how your bundler is handling the default export. You could try checking your tsconfig.json has "esModuleInterop": true and "moduleResolution": "node" or "bundler".AI Evy
12/18/2025, 1:31 PMAI Evy
12/18/2025, 1:31 PMYasserSE
12/18/2025, 1:36 PMAI Evy
12/18/2025, 1:36 PMAI Evy
12/18/2025, 1:36 PMretell-sdk in your Next.js environment.
The correct import syntax is:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
[(1) ]() , [(2) ]()
Steps to try:
1. Ensure you're using ES module imports — not CommonJS require() syntax [(1) ]()
2. Check your Node.js version — the SDK requires Node.js 18.10.0 or higher
3. Verify the package is installed correctly:
bash
npm install retell-sdk
[(2) ]()
4. If using Next.js 15+ with Turbopack, disable Turbopack by running next dev without the --turbo flag — there are known compatibility issues
5. Check your tsconfig.json has "esModuleInterop": true — this affects how default exports are handled
6. The SDK is server-side only — ensure your code is running in a server context, not client-side React components
If the issue persists after these steps, this may be a bundler-specific configuration problem with how your project resolves ES module default exports. Consider reaching out via [Contact Sales]() or checking [) .AI Evy
12/18/2025, 1:36 PMAI Evy
12/18/2025, 1:36 PM