Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7188

NodeJS crashes after sometime of leading a csv file

$
0
0

I've been working on a project that outputs xml upon reading a csv, I use the fs.createReadStream() method to read the csv file but after some time, the terminal just crashes.

And I get

C:\Users\username\Documents\Programming\Node Projects\DAE Parser\main.js:13
      row["Value"].includes("tri") ||
                   ^

TypeError: Cannot read property 'includes' of undefined

It doesn't read the whole file.

here's what i'm doing

fs.createReadStream("test.csv")
  .pipe(csv())
  .on("data", row => {
    if (
      row["Value"].includes("tri") ||
      row["Value"].includes("vt") ||
      row["Value"].includes("vx") ||
      row["Value"].includes("vn")
    ) {
      console.log(row)
    }
  })

Viewing all articles
Browse latest Browse all 7188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>