I am following the examples for reading CSV with Promises described in How to load data from a CSV file in D3 v5
but neither suggested solutions are working for me.
d3.csv('./data_files/NYC.csv')
.then(function(data) {
console.log(data)
})
.catch(function(error){
console.log('oops ' + error);
})
produces Error 0. I know it is not an URL problem because when I specify a non-existent file it returns file not found error.
The other solution suggested is
async function doThings() {
const data = await d3.csv('./data_files/NYC.csv');
console.log(data)
}
doThings();
which produces "Unhandled Promise Rejection: Error: 0
This seems straightforward but I can't figure it out. What am I doing wrong?