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

310
Vistas
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 Respuestas
Responde la pregunta

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