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

324
Views
Axios "TypeError: no se pueden leer las propiedades de undefined (leyendo 'entonces')" a pedido

Estoy tratando de hacer una solicitud GET usando Axios para mi bot de Discord, pero tengo un problema.

 var axios = require("axios"); var response; function getItemPrice(name, time) { axios.get("https://url.com/api/id=${name}&time=${time}") } response = getItemPrice("name", "time"); response.then(function(dataResponse){ console.log(dataResponse.data); } ).catch(function(error){ if(error){ console.log(error); } });

Cambié la URL. Mostrar esto en la consola ↓

TypeError: no se pueden leer las propiedades de undefined (leyendo 'entonces')

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tienes que usar acentos graves (``) en URL para usar literales de plantilla. Y también use el retorno de la función getItemPrice.

Ejemplo:

 axios.get(`https://url.com/api/id=${name}&time=${time}`)
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!