Closed MichaelJCole closed 7 months ago
Hello,
We are using node-addon-api and multiple loading should not be a problem.
I tried the same test with this project https://github.com/julusian/node-jpeg-turbo It is also using cmake + node-addon-api I could not regenerate the issue with node-jpeg-turbo.
Then I compared the cmake files and the problem is about CXX_STANDARD. (I don't know the reason) If you create a hello world module and set the CXX_STANDARD version to 17, then you get the error.
By the way, I can not generate the issue with Jest. libdatachannel (base lib) is using V17 as standard, so changing is not an option.
I do not have any idea about vite also.
Hi Murat, thank you. I'm not familiar with the tools and this is very helpful. I'll check in with vite and electron.
Hi @murat-dogan
I'm using your package through as a dependency of the libp2p stack.
I'm having the issue below. You can find a reproduction here: https://github.com/MichaelJCole/node-datachannel-reproduction
The issue is:
I'm using the module with electron-vite and vitest. When I run vitest, I'm using electron's node like this:
npm run test
will pass on the first run, but if you hit enter, vitest will run the tests again and fail with the error.I saw some other similar but different bugs. Is the module's registration re-entrant? Can it run more than once in the same node process?
Thank you!