I recently took an interest in Dart, and followed their tutorial pirate badge. After completion, I built it and uploaded to my webserver. In the start of the app, it calls a .json file:
static Future readyThePirates() {
var path = 'piratenames.json';
return HttpRequest.getString(path).then(_parsePirateNamesFromJSON);
}
void main() {
//... other code
PirateName.readyThePirates()
.then((_) {
inputField.disabled = false;
genButton.disabled = false;
setBadgeName(getBadgeNameFromStorage());
})
.catchError((arrr){
print('Error initializing pirate names: $arrr');
badgeNameElement.text = 'Arrr! No names.';
});
}
//... more code
}
Here is a screen of my FTP:
Obviously the file is there, but when I load it up in a browser I get an error. Inspecting in Chrome I get this:
It works just fine when I run it in Dartium (from the Dart editor), not sure why it is having an issue on a live page.
Anyone know what might be going on?