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

477
Vistas
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 Respuestas
Responde la pregunta

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 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