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

309
Views
Uncaught TypeError: root is undefined papaparse

I have a problem with papaparse in my code, I try to parse a string but is giving me this error:

Uncaught TypeError: root is undefined"

the code is like:

import * as Papa from "../file/papaparse/papaparse.js";
input.onchange = e => {
  var file = e.target.files[0];
  var reader = new FileReader();
  reader.readAsText(file, 'UTF-8');
  reader.onload = readerEvent => {
    let imported = readerEvent.target.result;
    let splittedimp = this.$Papa.parse(imported, {
      "header": true
    })
    console.log(splittedimp);
  }
}

the input.onchange is inside an async function. any idea why this error? The error happen in papaparse file, line 25: root.Papa = factory(); also i didn't use nodejs or jquery, i have simply downloaded the file and imported it into a folder in my project

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

0

The problem was that papaparse didn't like the import as. I have added the URL into the script in the HTML page connected to the JS page and now works fine.

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!