Skip to content

Running into 'BitmovinApi is not a constructor' error #6

@internetdrew

Description

@internetdrew

This might be only if using es6 modules since I see reference to 'default' in the require() flow.

With require instructions:
const BitmovinApi = require('@bitmovin/api-sdk')["default"];

es6 import instructions currently:
import BitmovinApi from '@bitmovin/api-sdk';

Documentation shows the following to create a new instance of the BitmovinApi:

const bitmovinApi = new BitmovinApi({
  apiKey: 'API_KEY',
});

But on further inspection, there is a method on the BitmovinApi object itself called 'default' that actually returns the constructor function.

So to create a new instance successfully you must:

const bitmovinApi = new BitmovinApi.default({
  apiKey: 'API_KEY',
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions