Open fstojanovic opened 3 years ago
I haven't used rclnodejs with Electron, I think @koonpeng has some experiences with Electron env, @koonpeng would you please have a look at this issue? Have you ever met sort of the error? Some comments, hope it helpful
When run if built for node, the following message pops up :
I don't think it could be workable with nodejs build, as you saw was compiled against a different Node.js version using
was reported.
due to missing headers and dependencies.
What's the header missed? Is it ROS2 headers or what else?
running it for electron gives : "rclnodejs.node" is not a module.
Can you find the rclnodejs.node
under the build/
folder? It seems that the lib doesn't get generated.
There is a bug in the current version of electron which causes rclnodejs to not work, the fix is currently scheduled in v11 beta. Also, if you are loading rclnodejs in the renderer process you need to disable renderer reuse (there's a flag somewhere in electron api). This is because rclnodejs is not "context-aware" and reusing the same process can cause unexpected behaviours.
That being said, the error "rclnodejs.node is not a module" may be caused by some problems in the compilation process. You can start by checking if the file exists and see if there is any error messages during the compilation.
Thanks for @koonpeng 's quick explanation, that's helpful!
This is because rclnodejs is not "context-aware"
I think we could improve this?
@minggangw , @koonpeng
Thank you for your replies. I will keep you posted about the issue, soon I'll update this issue thread. Also, it doesn't build for any Electron version, not just the current one.
@koonpeng @fstojanovic does rclnodej
s build with electron
on WSL2 Ubuntu 20.04?
Thanks all!
@minggangw , @koonpeng
Thank you for your replies. I will keep you posted about the issue, soon I'll update this issue thread. Also, it doesn't build for any Electron version, not just the current one.
Hi @fstojanovic, are you able to resolve this issue
It would appear that it is not possible to run with Electron on Windows.
When run if built for node, the following message pops up :
When I try to rebuild it for Electron using electron-rebuild, the build always fails, due to missing headers and dependencies. Once I manually resolve all those errors and it finally builds, running it for electron gives : "rclnodejs.node" is not a module.
When run for Node, without Electron, it works as expected.