what I wanna do is to read csv file(which is in my directory) in vue.js
what i tried first was
import Papa from "papaparse";
import csvFile from "../../../assets/files/mediList.csv";
Papa.parse(csvFile, {
download: true,
encoding: "UTF-8",
complete: function (results) {
console.log(results);
},
});
and got errors
Module parse failed: Unexpected character '�' (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
I got the same error when i only leave the code below
import csvFile from "../../../assets/files/mediList.csv";
I also tried to use fs module but failed as it is not node js.
what should I do to just read the local csv file that is located in the same directory?