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

152
Views
Cannot read properties of undefined (reading 'split')

I am trying to use 'split' in nodejs and I am getting can not read property of undefined (reading 'split') error. Does anybody have a clue how I can solve this? Here is a snippet of my code. I am using node version 16.13.1.

***var config = require('./decrypt.js');
var temp = config.replace('{','');
temp = temp.replace('}','');
temp = temp.split(',');
var userArr=temp[0];
var passArr=temp[1];
var serverArr=temp[2];
var dbArr=temp[3];
var usertemp = userArr.split(':');
var passtemp = passArr.split(':');
var servertemp = serverArr.split(':');
var dbtemp = dbArr.split(':');***
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You cannot use split on array, its for String.

You can only use it on a String

about 4 years ago · Juan Pablo Isaza Report

0

You can debug your code or log it to the browser's, e.g. Chrome, dev console to determine which variable is undefined.

var config = require('./decrypt.js');
var temp = config.replace('{','');
temp = temp.replace('}','');
console.log({ config : config, temp: temp });
temp = temp.split(',');
console.log(temp);

Chrome dev

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!