From 47ba445da6466df2452b8b52e3f2ea82036ec3be Mon Sep 17 00:00:00 2001 From: Murat Dogan Date: Sun, 24 Nov 2024 14:24:25 +0100 Subject: [PATCH] fix module require process --- src/lib/node-datachannel.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/node-datachannel.ts b/src/lib/node-datachannel.ts index bd1c83c..da827ad 100644 --- a/src/lib/node-datachannel.ts +++ b/src/lib/node-datachannel.ts @@ -5,6 +5,11 @@ try { nodeDataChannel = require('../../../build/Release/node_datachannel.node'); } catch (e) { + // If this is not a module not found error, rethrow it + if (e.code !== 'MODULE_NOT_FOUND') { + throw e; + } + // from src nodeDataChannel = require('../../build/Release/node_datachannel.node'); }