diff --git a/core/config/load.ts b/core/config/load.ts index 95fc73053..4388d94b0 100644 --- a/core/config/load.ts +++ b/core/config/load.ts @@ -595,7 +595,20 @@ async function loadFullConfigNode( try { // Try config.ts first const configJsPath = getConfigJsPath(); - const module = await import(configJsPath); + let module: any; + + try { + module = await import(configJsPath); + } catch (e) { + console.log(e) + console.log("Could not load config.ts as absolute path, retrying as file url ..."); + try { + module = await import(`file://${configJsPath}`); + } catch (e) { + throw new Error("Could not load config.ts as file url either", { cause: e }); + } + } + if (typeof require !== "undefined") { delete require.cache[require.resolve(configJsPath)]; }