Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

435
Vistas
TypeError: obj is not a constructor (error in js / node)

Note: I'm normally coding in Python, so I am completely new to javascript.

I'm trying to use the following repo: https://github.com/omerdn1/otter.ai-api

I used the setup code, but I replaced the import with the following instead: const OtterApi = require('otter.ai-api') because I was getting SyntaxError: Cannot use import statement outside a module.

However, now I'm getting the following error: TypeError: OtterApi is not a constructor. If I look at index.js in the repo, it does look like a constructor? First part of the code is:

class OtterApi {
  constructor(options = {}) {
    this.options = options;
    this.user = {};
    this.csrfToken = '';
  }

  init = async () => {
    await this.#login();
  };

The code I'm trying to run:

const OtterApi = require('otter.ai-api');

const otterApi = new OtterApi({
    email: 'email', // Your otter.ai email
    password: 'pw', // Your otter.ai password
});

async function main() {
    await otterApi.init() // Performs login
}

main();

I get the error when using new OtterApi(). I'm not sure how to resolve this.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You need to refer to the "default" export:

const OtterApi = require('otter.ai-api').default;
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda