I'm following a tutrotial and all off a sudden i'm getting this error . I've tried all solution and reinstall module. but in other class the same code work
this is my code
import fileSaver from 'file-saver';
uploadPensiun(event) {
const files = event.target.files
const formData = new FormData()
formData.append('Pensiun', files)
fetch('http://localhost:5000/uploadpensiun', {
method: 'POST',
body: 'Pensiun',
headers: {
'Accept': 'application/json',
'Content-Type': 'multipart/form-data'
},
})
.then(res => res.json())
.then(data => console.log(data))
.catch((err) => console.log(err));
}
anyone can help me please?
Install the
file-saver
with npm:
npm install file-saver
or with yarn:
yarn add file-saver