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

476
Views
Unable to pull data from JSON file, ReferenceError getFile is not Defined

I am unable to pull JSON file data from the Uniswap_Surface_Rates.json file. enter image description hereIt keeps giving me Reference error : getFile is not defined.

I think I'm not entering the relative path correctly but neither google nor youtube searches have helped.

These are the absolute paths for the files

F:\Downloads\Triangular Arbitrage\RESOURCES\Uniswap2JS\main.js

F:\Downloads\Triangular Arbitrage\RESOURCES\UniSwap2\Uniswap_Surface_Rates.json

// GET DEPTH //////////////////
async function getDepth(amountIn, limit) {
  
    // Get JSON Surface Rates 
    console.log("Reading Surface Rate Information...")
        let fileInfo = getFile("..\UniSwap2\Uniswap_Surface_Rates.json");
        fileJsonArray = JSON.parse(fileInfo);
        fileJsonArrayLimit = fileJsonArray.slice(0, limit);
        console.log(fileJsonArrayLimit);
    
    
        return
    }

    getDepth(amountIn=1 , limit=2)
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your error says:

ReferenceError getFile is not Defined

This means the getFile itself is not defined. So the problem is not with the path.

Where is the getFile function declaration? Or where are you importing it from?

Maybe you meant to use fs.readFile? Or fsPromises.readFile?

But if you do have a getFile() declared or imported somewhere, please add it to the question, along with the rest of the code where you import the function into the file you declared getDepth().

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!