Next.js Discord

Discord Forum

CSV Files

Little Stint posted this in #help-forum
Open in Discord
Little StintOP
Anyone know how to read a local CSV file in Next.js?

I am using Papaparser and I am trying to import/use my csv file but nothing works. I researched online and people said to edit th webpack and I tried that but getting errors:

Cannot find module '../_dataset/test.csv' or its corresponding type declarations.

3 Replies

Schweizerischer Niederlaufhund
Can you show the file where you’re trying to access it?
Little StintOP
Nvm got it working! Thanks for reaching out!
was there anything specific you did to fix as it could be nice to others that come across this in future, but eitherwise very cool 🙂