Closed DartBot closed 9 years ago
This comment was originally written by am...@gmail.com
please change title, I oversaw that one. should read "HTTPRequest never executes in compiles JS"
Added Area-Dart2JS, Triaged labels. Changed the title to: "HTTPRequest never executes in compiles JS".
This looks like the http-request for the piratenames.json doesn't succeed.
I just tried the dart and js versions (from within the Dart editor), and both worked fine for me.
Could you please verify that the piratenames.json file is available to the dart2js-version too?
Added NeedsInfo label.
This comment was originally written by ambus...@gmail.com
The file is available. I now realise that I omitted a very important clue: from within the Dart Editor both work. It is when I double-click the piratebadge.HTML file directly in Explorer, then the HTTPRequest never ends, and thus the .THEN is not executed. All 5 previous versions work: in Dartium, in Dart editor as compiled JS and executing the .HTML
This is working as intended. The browser won't allow to load files, if the html is loaded through "file://". That's why it works from within the DartEditor.
The console prints (in both Dartium and Chromium): XMLHttpRequest cannot load file:///<path>/pirate/web/piratenames.json. Cross origin requests are only supported for HTTP.
Added AsDesigned label.
This comment was originally written by ambusy...@gmail.com
I got the answer too, while walking (a long passage) with the dog: clicking the HTML runs without a server, so who is going to serve me? nobody of course. Dart editor creates the 127.0.0.1 server before executing the script
This issue was originally filed by ambusy...@gmail.com
What steps will reproduce the problem?
What is the expected output? What do you see instead? I expect the screen to be equal to the Dartium version. It is not: de two buttons remain disabled. Which means that the statement PirateName.readyThePirates() .then((_) { //on success inputField.disabled = false; //enable genButton.disabled = false; //enable setBadgeName(getBadgeNameFromStorage()); }) .catchError((arrr) { print('Error initializing pirate names: $arrr'); badgeNameElement.text = 'Arrr! No names.'; }); never executes the .then branch
What version of the product are you using? On what operating system? Dart Editor version 1.0.0_r30798 (STABLE) Dart SDK version 1.0.0.10_r30798 Windows 7 SP1
Please provide any additional information below. exercises 1 to 5 run in Dartium and in compiled Js without difference