EvenAR / node-simconnect

A cross platform SimConnect client library for Node.JS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bytebuffer format on electron.

joaogn opened this issue · comments

I'm trying to use this excellent lib on the electron. But I have a weird bug.

I'm receiving this error on electron;

Screenshot 2023-02-11 at 13 42 44

So I started to investigate and I found the main point of the error, basically, it looked like running two different versions of bytebuffer.

  • on electron
    Screenshot 2023-02-11 at 13 39 32

  • on node
    Screenshot 2023-02-11 at 13 39 47

I tried to investigate the package-lock but I don't find anything relevant.

Do you have any idea what could be?

Okay I find the problem.

https://github.com/protobufjs/bytebuffer.js/blob/master/src/bytebuffer.js

The bytebuffer ise ArrayBuffer if isn't node.

Screenshot 2023-02-11 at 13 58 09

I will check if I can find a solution.

I force to use directly the node version to work. There is an elegant way to force use the node version?

Screenshot 2023-02-11 at 14 09 23

Hi! I think this only will be an issue when using node-simconnect from the renderer process. In my Electron application I use the main process for sim interaction, and IPC for data transfer between the main and renderer process. That's the most elegant solution I know of at the moment.

Weird, I'm using in the main too, and using IPC. Maybe is anything in my electron setup, I will check. Thx.

Did you find a solution, @joaogn ?

Sorry by the late reply, I find a workaround, I'm using "electron-vite" to build my app, so I suppose should it that it recognize as web. Bassicaly I'm using 'vite-plugin-static-copy' to copy the 'bytebuffer-node.js' to the 'bytebuffer.js' in the build process, So this solved my problem.