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

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

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