Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

254
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda