Paul Dickinson
Paul Dickinson

Reputation: 93

d3-request incorrectly assembling a path and using wrong host

I'm running a server via npm start on 10.0.1.18:3000. I'm doing:

import * as request from 'd3-request';
const myPath = './data/my_file.json';
request.json(myPath, (error,data)=>console.log(error,data));

This is failing, with an error: "Failed to execute 'fetch' on 'Window': Failed to parse URL from //localhost:80./data/my_file.json"

It seems like there are two problems:

Upvotes: 1

Views: 86

Answers (0)

Related Questions