I'm trying to parse a local csv in svelte but the logged object has nothing to do with the parsed file. The file is in the /src/db-csv/
folder.
+layout.server.js
import Papa from 'papaparse'export const load = async ({ params, fetch }) => { const result = await fetch("http://localhost:5173/db-csv/customers.dat", { headers: { "content-type": "text/csv;charset=UTF-8" }, }); const fileContent = await result.text(); let parsedCsvCstomers = Papa.parse(fileContent, {header: true}) return { customers: parsedCsvCstomers.data };};
Also the csv has 8000 rows, the array has less objects and It looks like it's reading the svelte page.