It works when I fetch a tsv
file remotely:
// Works well
fetch(
`https://raw.githubusercontent.com/reactivemarkets/react-financial-charts/master/packages/stories/src/data/MINUTES.tsv`,
)
.then((response) => response.text())
.then((data) => tsvParse(data, parseData()))
.then((data) => {
this.setState({
data,
});
})
.catch(() => {
this.setState({
message: `Failed to fetch data.`,
});
});
However, if I copy this file locally (both in the same directory as the .tsx
file, as well as in the project's root directory), and replace the argument of the fetch
function, it doesn't work.
// Doesn't work if I change the fetch input to this:
fetch('MINUTES.tsv')
// Also doesn't work
fetch('./MINUTES.tsv')
I get this error in the console output:
GET http://localhost:9000/minutes.tsv 404 (Not Found)