It compiles now, but throws this at runtime:
Uncaught TypeError: Cannot read property 'substr' of null
at Function.HxOverrides.substr
at haxe_remoting_HttpConnection.call
This is under js
EDIT: so i think the issue is that its trying to use a sync http, and under nodejs that isnt a thing (or doesnt seem to be looking at the code):
#if (js && !nodejs)
h.async = false;
#end
I tried to use HttpAsyncConnection
but dont seem to be getting anywhere
EDIT2: Ok, so i can get it compile by using HttpAsyncConnection
and haxe.remoting.AsyncProxy
:
class HaxelibApi extends haxe.remoting.AsyncProxy<data.haxelib.SiteApi> {
public static function connect() {
return new HaxelibApi(haxe.remoting.HttpAsyncConnection.urlConnect("http://lib.haxe.org/api/3.0/").resolve("api"));
}
}
And changing the call to something like:
_api = HaxelibApi.connect();
_api.search("haxeui-core", function(list:List<{id:Int, name:String}>) {
trace(list);
});
however, now i get this at runtime:
haxe_ValueException {message: "Invalid path ''", __previousException: undefined, __nativeException: haxe_ValueException, value: "Invalid path ''"}
message: "Invalid path ''"
value: "Invalid path ''"
FINAL EDIT!!! Ok, so ignore more!
I had edited HttpAsyncConnection
yesterday to hardcode things… doh! Works fine now… sorry for the spam!