I just recently tried switching to d3 v5 from v4, and I am getting 401 (Unauthorized) errors every place I use d3.json. I cannot seem to figure out what changed or if this is a bug.
Here is a typical call to a random data set in v4, which works perfectly fine with the v4 library:
var url = "somedata.json";
d3.json(url, function(error, json) { console.log(json); });
I changed the code appropriately for v5 and get a 401 error:
var url = "somedata.json";
d3.json(url).then(function(data){
console.log(data);
});
My apologies if I did not make it clear initially that the problem is the 401 error. Apart from the promise construct, the only change was the d3 version.
I created a plunk for this and it works just fine: https://plnkr.co/edit/iTZzdc27eJaubiOJvmsi?p=preview
I am thinking the problem is a combination of the d3 v5 library with my web server (which is on a private network): IIS using Windows domain security. Since version 4 (and all previous versions) have worked great, I am thinking either something changed with d3, or I need to do something more in the request.