I am trying to read the CSV file using PapaParse but facing CORS policy error:
index.html:1 Access to XMLHttpRequest at 'file:///Users/macbook/Downloads/hh/csv/Patient_Experience.csv' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
I am using following code snipped
var myurl='csv/Patient_Experience.csv';
Papa.parse(myurl, {
header: true,
download: true,
dynamicTyping: true,
complete: function(results) {
console.log(results);
}
});
Also, file is present in csv directory like that csv/Patient_Experience.csv I tried to put csv file in s3 and allow cors policy there but still facing same issue.
Note: I am not using any node or any other library. Its simple plain HTML, JS flow.