From 97e7ce5a9e428f3954ef00512127f127d7eb4ef2 Mon Sep 17 00:00:00 2001 From: Jelle De Loecker Date: Mon, 20 May 2024 16:00:00 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20import=20bug=20in=20`Blast?= =?UTF-8?q?.requireFileViaVm`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/server_functions.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/server_functions.js b/lib/server_functions.js index 38b4ece..e93cd9d 100644 --- a/lib/server_functions.js +++ b/lib/server_functions.js @@ -1584,7 +1584,7 @@ module.exports = function serverFunctions(Blast, extras) { * * @author Jelle De Loecker * @since 0.9.0 - * @version 0.9.0 + * @version 0.9.3 */ Blast.requireFileViaVm = function requireFileViaVm(path, options) { @@ -1609,6 +1609,7 @@ module.exports = function serverFunctions(Blast, extras) { let exported_function = libvm.runInThisContext(head + source + '\n/**/})', { filename: path, lineOffset: -1, + importModuleDynamically: libvm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER }); let args = [ diff --git a/package.json b/package.json index 4a121fc..a07f528 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,6 @@ "mm" : "~3.2.1" }, "engines": { - "node" : ">=14.0.0" + "node" : ">=20.13.0" } } \ No newline at end of file