EvenAR / node-simconnect

A cross platform SimConnect client library for Node.JS
GNU Lesser General Public License v3.0
95 stars 33 forks source link

Bytebuffer format on electron. #64

Closed joaogn closed 1 year ago

joaogn commented 1 year ago

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.

Do you have any idea what could be?

joaogn commented 1 year ago

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.

joaogn commented 1 year ago

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

EvenAR commented 1 year ago

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.

joaogn commented 1 year ago

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

EvenAR commented 1 year ago

Did you find a solution, @joaogn ?

joaogn commented 1 year ago

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.