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

354
Vistas
TypeError: Cannot read property 'replace' of null - Axios

I have some code that was working now it currently isn't even though the code hasn't changed. I am on a different computer now though.

I am getting an error about replacing a value with null though I have done some testing (console.log) and looks like nothing is coming back null. Below is the code as well as the error message. I did check the 'config' variable and it does have a value. I am wondering what this error means/what is causing it. I have tried google and found a few issues about it however none have a solution in them just a lot of "me too" responses.

Code

console.log(message)
axios.post(config.EXPRESS_URL, {
      content: message.content,
      abut_code: message.abut_code,
      media_url: '',
      userID: message.userID,
      name: message.name
}, {headers})
.then(() => {
      console.log('Message sent')
})
.catch(err => {
      console.log(err)
})

Error message/console output

{
  content: 'test',
  abut_code: 'bff1377f:d7de22eb',
  userID: 'auth0|613a9e709518390070831c29',
  name: 'Me 2'
}
TypeError: Cannot read property 'replace' of null
    at dispatchHttpRequest (/Users/me/projects/tenanttalk/backend/websocket/node_modules/axios/lib/adapters/http.js:109:74)
    at new Promise (<anonymous>)
    at httpAdapter (/Users/me/projects/tenanttalk/backend/websocket/node_modules/axios/lib/adapters/http.js:46:10)
    at dispatchRequest (/Users/me/projects/tenanttalk/backend/websocket/node_modules/axios/lib/core/dispatchRequest.js:52:10)
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I had the same error when the provided url was not correct (I forgot the "http://" in the url in my case) check config.EXPRESS_URL and make sure it's a valid url.

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