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

247
Vistas
React - Error when importing node package (Object prototype may only be an Object or null)

I am trying to implement this library with my React applicaiton however, I get an error when I import the package.

Error - TypeError: Object prototype may only be an Object or null: undefined

Package - https://www.npmjs.com/package/dukascopy-node

I tried importing it both ways, using require and using import from however it gives the same output

Function

import { getHistoricRates } from "dukascopy-node";

export const getHistoricalData = async (
  instrument = "btcusd",
  from = new Date("2018-01-01"),
  to = new Date("2019-01-01"),
  timeframe = "d1"
) => {
  try {
    const data = await getHistoricRates({
      instrument: instrument,
      dates: {
        from: from,
        to: to,
      },
      timeframe: timeframe,
      format: "json",
    });

    console.log(data);
  } catch (error) {
    console.log("error", error);
  }
};
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

As the import statement looks OK, there must be something wrong with your packages. I would try to delete the node_modules folder and reinstall all packages. This is my go-to solution in such strange, unexplainable cases with imports.

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