Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

244
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!