You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get this to run on Node 20.14.0 (Typescript) and for the life of me I cannot figure out what's going on. As soon as import { Server, Client } from 'node-osc'; exists in the code, the NodeJS process immediately closes upon launch, no errors or uncaught exceptions - nothing. As soon as I remove the import, everything is working again.
This is my code, but i'm not even calling setupOscClient() or setupOscServer() and it still crashes randomly. I can't get a debugger attached to it either because of this behaviour. Any help would be appreciated.
import { Server, Client } from 'node-osc';
let oscClient: Client | null = null;
let oscServer: Server | null = null;
function setupOscClient() {
if (globalSettings.enableComs !== '1') {
return;
}
const ipAddress = globalSettings.ipAddress || '127.0.0.1';
const port = 10024;
if (oscClient) {
oscClient.close();
globalSettings.oscConnected = false;
saveGlobalSettings();
}
try {
oscClient = new Client(ipAddress, port);
globalSettings.oscConnected = true;
saveGlobalSettings();
ConsoleLog(`Connected to ${ipAddress}:${port}`, LogLevel.INFO, true);
} catch (err) {
console.log(err)
}
}
function setupOscServer() {
const ipAddress = globalSettings.ipAddress || '127.0.0.1';
const port = 10024;
if (oscServer) {
oscServer.close();
}
oscServer = new Server(port, ipAddress);
oscServer.on('message', function (msg) {
ConsoleLog(`Received OSC message: ${msg}`, LogLevel.INFO, true);
handleIncomingData(msg.toString());
});
ConsoleLog(`OSC server listening on port ${port}`, LogLevel.INFO, true);
}
The text was updated successfully, but these errors were encountered:
Further debugging is showing that oscClient = new Client(ipAddress, port); or oscServer = new Server(port, ipAddress); is directly causing the issue, where it refuses to load.
I'm trying to get this to run on Node 20.14.0 (Typescript) and for the life of me I cannot figure out what's going on. As soon as
import { Server, Client } from 'node-osc';
exists in the code, the NodeJS process immediately closes upon launch, no errors or uncaught exceptions - nothing. As soon as I remove the import, everything is working again.This is my code, but i'm not even calling
setupOscClient()
orsetupOscServer()
and it still crashes randomly. I can't get a debugger attached to it either because of this behaviour. Any help would be appreciated.The text was updated successfully, but these errors were encountered: