From 1ba1fe23fc4dcd23c88d67804d9fb58873475f2b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 23 Oct 2025 11:58:00 +0200 Subject: [PATCH] Bug 36674: Fix warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WARNING in ./koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js ⚠ Module parse warning: ╰─▶ ⚠ Critical dependency: the request of a dependency is an expression ╭─[226:26] 224 │ key, 225 │ createClientProxy(function() { 226 │ return import(path); · ───── 227 │ }) 228 │ ]; ╰──── --- koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js b/koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js index ef758dbc9ba..93e1ece7aed 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js +++ b/koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js @@ -196,10 +196,11 @@ const apiClientFiles = { default: "./default-api-client.js", }; +const context = require.context("./", false, /\.js$/); export const APIClient = Object.fromEntries( Object.entries(apiClientFiles).map(([key, path]) => [ key, - createClientProxy(() => import(path)), + createClientProxy(() => context(`./${path}.js`)), ]) ); -- 2.34.1