I seem to have no problem loading files remotely, but when it comes to getting them locally from the assets folder inside the project I have trouble. My code:
return fetch("myLocalFile.csv")
.then(response => response.text())
.then(data => console.log("Data is:"+data));
but it just returns:
Data is: <html
400 Bad Request
I tried this too:
this.local_file = this.app.assets.find("myLocalFile.csv");
return fetch(this.local_file)
.then(response => response.text())
.then(data => console.log("Data is:"+data));
The local file exists within my assets and is not set to be excluded.
I initially had the file uploaded as a binary but later changed it to type ‘text’. However, I get the same errors.