Skip to content

[Bug]: TypeError: nodejs_client_1.default is not a constructor when using @api.video/nodejs-client in NestJS #240

@martijnvanderpol

Description

@martijnvanderpol

Version

2.6.8

Environment that reproduces the issue

Environment that reproduces the issue:

  • Platform: macOS
  • Node.js: v24
  • Framework: NestJS v11.1.8
  • Language: TypeScript

Is it reproducible in the example application?

Not tested

Reproduction steps

  1. Create a new NestJS service.
  2. Install @api.video/nodejs-client@2.6.8 via yarn
  3. Use the following code snippet:
import { Injectable, Logger } from '@nestjs/common';
import ApiVideoClient from '@api.video/nodejs-client';

@Injectable()
export class ApiVideoService {
  private readonly logger = new Logger(ApiVideoService.name);
  private readonly client: ApiVideoClient;

  constructor() {
    this.client = new ApiVideoClient({
      apiKey: 'SECRET_API_KEY',
    });
  }
}
  1. Start the application using npm run start or yarn start.

Expected result

The application should start successfully, initializing the ApiVideoClient without any errors.

Actual result

TypeError: nodejs_client_1.default is not a constructor

Additional context

I followed the documentation in the README, and everything seems aligned with the examples provided. However, the error occurs as soon as the service is instantiated.

Any help would be greatly appreciated.

Kind regards,
Martijn

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions