We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: fs.readFileSync is not a function
I'm creating my application with Vite and I receive an error when trying to convert CSV to JSON
yarn create vite
const { acceptedFiles, getRootProps, getInputProps } = useDropzone({ accept: { 'text/csv': ['.csv'] }, onDrop: files => { const file = files[0]; const reader = new FileReader(); reader.onload = () => { const json = csvToJson .fieldDelimiter(';') .getJsonFromCsv(reader.result as string); console.log(json); }; reader.readAsText(file); }, });
Uncaught TypeError: fs.readFileSync is not a function at FileUtils.readFile (convert-csv-to-json.js)
"convert-csv-to-json": "^2.44.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", "vite": "^5.2.0"
https://vitejs.dev/guide/troubleshooting#module-externalized-for-browser-compatibility
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Actual Behavior
TypeError: fs.readFileSync is not a function
I'm creating my application with Vite and I receive an error when trying to convert CSV to JSON
Steps to Reproduce the Problem
yarn create vite
(ReactJS + Typescript)Specifications
Node V20.9.0
Recommendation
https://vitejs.dev/guide/troubleshooting#module-externalized-for-browser-compatibility
The text was updated successfully, but these errors were encountered: