From 56a3cdc2f0ee7616741d5af7a40aaa194e599307 Mon Sep 17 00:00:00 2001 From: Mario Liebisch Date: Wed, 4 Oct 2023 16:28:13 +0200 Subject: [PATCH] Web: Catch using GDExtensions in a non-dlink build Previously this would simply fail with a cryptic `me.rtenv.loadDynamicLibrary is not a function` error. --- platform/web/js/engine/engine.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/web/js/engine/engine.js b/platform/web/js/engine/engine.js index fb80bd55e1..3d6720a2fc 100644 --- a/platform/web/js/engine/engine.js +++ b/platform/web/js/engine/engine.js @@ -164,6 +164,10 @@ const Engine = (function () { // Preload GDExtension libraries. const libs = []; + if (me.config.gdextensionLibs.length > 0 && !me.rtenv['loadDynamicLibrary']) { + return Promise.reject(new Error('GDExtension libraries are not supported by this engine version. ' + + 'Enable "Extensions Support" for your export preset and/or build your custom template with "dlink_enabled=yes".')); + } me.config.gdextensionLibs.forEach(function (lib) { libs.push(me.rtenv['loadDynamicLibrary'](lib, { 'loadAsync': true })); });