getnamo / NodeJs-Unreal

Embed node.js as an Unreal Engine plugin.
MIT License
239 stars 34 forks source link

SocketIO Invalid appears to have lost connection in UE 4.24 #18

Closed xmak closed 4 years ago

xmak commented 4 years ago

After solving the problem in #17 I ran into another one...

With the node executable in place, Unreal editor doesn't crash anymore, but I cannot start a node script. When I start the project, the node.exe process (which I suppose its the main thread) is active for a second and then it shuts down.

I get these messages in the output log:

SocketIOLog: SocketIO Invalid appears to have lost connection, reconnecting attempt 0 with delay 5000 LogTemp: Error: Main script connection error! Likely crash, stopping main script. SocketIOLog: SocketIO Invalid appears to have lost connection, reconnecting attempt 1 with delay 7500 LogTemp: Error: Main script connection error! Likely crash, stopping main script. SocketIOLog: SocketIO Invalid appears to have lost connection, reconnecting attempt 2 with delay 11250 LogTemp: Error: Main script connection error! Likely crash, stopping main script.

I'm using the latest master of socketio-client-ue4 plugin.

Am I doing something wrong?

Here is the test project:

https://drive.google.com/open?id=16S7qequ2-U83GnOZUGHd05vkInvIlQJX

This is a BP only project, but the same thing happens on another project which has C++ code.

xmak commented 4 years ago

P.S. The messages in the output log continue even after I shut down the project and return to editor:

SocketIOLog: SocketIO Invalid appears to have lost connection, reconnecting attempt 3 with delay 16875 LogTemp: Error: Main script connection error! Likely crash, stopping main script. SocketIOLog: SocketIO Invalid appears to have lost connection, reconnecting attempt 4 with delay 25000 LogTemp: Error: Main script connection error! Likely crash, stopping main script. SocketIOLog: SocketIO Invalid appears to have lost connection, reconnecting attempt 5 with delay 25000 LogTemp: Error: Main script connection error! Likely crash, stopping main script. SocketIOLog: SocketIO Invalid appears to have lost connection, reconnecting attempt 6 with delay 25000 LogTemp: Error: Main script connection error! Likely crash, stopping main script.

getnamo commented 4 years ago

You didn't do step 2 of https://github.com/getnamo/nodejs-ue4/issues/17#issuecomment-619346058 npm install dependencies inside the nodejs plugin content folder to install dependencies.

xmak commented 4 years ago

You're right, I forgot to do that step.

After running npm i in Plugins/nodejs-ue4/Content/Scripts folder it works, thank you.