Nodegui trying to retrieve wifi networks not being executed

Viewed 14

I'm trying to get a list of currently connected wifi SSID's, for which I use the node-wifi library, I tried with a very basic block of code, which is working in regular node. However even after doing a rebuild of the dependencies with qode I don't get it to work in nodegui, I started from the react-node-gui starter and added a button which calls this code:

import wifi from "node-wifi"

export const getCurrentWifiConnection = async () => {
    wifi.init({iface: null})
    console.log("lets get the networks...")
    let currentConnections
    try{
        currentConnections = await wifi.getCurrentConnections()
        console.log(currentConnections)
    } catch(e) {
        console.log(e)
    }

    return currentConnections
}

anyone who has an idea of what's going on? I don't see anything from my console.log with the current-connections or from the error (doesn't matter if I use console.log or console.error) the "let's get the networks" log message gets printed though, so the function is getting called.

I've tested this code on node-16 and it's running perfectly if nodegui isn't wrapped around it, I know nodegui is using it's own customized node runtime with extra bindings for QT events, so I believe this has something to do with the qode.

0 Answers
Related