Closed tong closed 1 year ago
@Onek8 Hi, sorry for the ping, do you know more about this by chance? The networking package seems to use sys stuff in a lot of places where it probably shouldn't, it's also happening in the original hxWebSockets but perhaps you know what to change in order to make it work? Should we open an issue about this on the hxWebSockets repo?
I also tried to add -D nodejs
to api.hxml to use the nodejs implementations referenced in the code, but Armory's networking package sadly doesn't include them:
../armory/Sources/armory/network/SocketImpl.hx:13: characters 22-54 : Type not found : armory.network.nodejs.NodeSocket
I agree that it's probably the best to disable this module for now in the docs until it's properly fixed.
Im not sure what you mean by trying sys, if you look at the nodes I made I put the #if sys properly so nothing will crash when trying to export a host socket to html for example. Regarding nodejs do you mean this ->
Ok it is back https://github.com/armory3d/armory/pull/2692
Perhaps the api build is having issues during the haxe version checking. You could try to remove the condition and assume the latest version to see if everything remains in scope. For example https://github.com/armory3d/armory/blob/main/Sources/armory/network/WebSocket.hx#L10 just assume typedef JsBuffer = js.lib.ArrayBuffer;
Ok it is back https://github.com/armory3d/armory/pull/2692
Thanks :) Sadly it's still not working just by adding -D nodejs
, but I think this might be due to api.hxml being generated for a different target (the error looks like it's missing something from the standard library). Does anyone know where the corresponding khafile is?
../armory/Sources/armory/network/nodejs/NodeSocket.hx:3: characters 8-19 : Type not found : js.node.Net
I think it's still useful though to have the nodejs socket classes included in Armory because nodejs is also available as a proper Kha target. It's kind of unmaintained though and often has compile errors after other Kha targets were updated, so it probably makes more sense anyways to fix the sys-related build errors instead of using nodejs for generating the API docs.
Im not sure what you mean by trying sys
This is probably the error message to which @ tong was referring:
../armory/Sources/armory/network/SecureSocketImpl.hx:3: characters 28-42 : You cannot access the sys package while targeting js (for sys.ssl.Socket)
If you wrap the line in question into #if sys
blocks, the same error simply happens somewhere else, over and over. I noticed that a few lines below that error message, dox prints Using Node.js version of dox...
, so perhaps we're already building using the node target in some way? I wish there was a khafile...
Fix api docs generation by excluding
armory.network
. I've tried to do it by adding#if sys ..
conditions without any luck.