From 0a836f76bbd15d72e3ed4a57b73ff375314e2c22 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Tue, 17 Dec 2024 13:43:33 -0500 Subject: [PATCH] Work around issue with Node 22 and Jiti (#15421) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #15374 If we always use Jiti the problem should, in theory, go away (I hope). It does mean that loading configs is slower than it would be if they're written in CJS but 🤷‍♂️ Wanna get this running with the integration tests to see if anything breaks. --- src/lib/load-config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/load-config.ts b/src/lib/load-config.ts index eaff8e95b..7eab412ca 100644 --- a/src/lib/load-config.ts +++ b/src/lib/load-config.ts @@ -33,6 +33,10 @@ function lazyJiti() { export function loadConfig(path: string): Config { let config = (function () { + // Always use jiti for now. There is a a bug that occurs in Node v22.12+ + // where imported files return invalid results + return lazyJiti()(path) + // Always use jiti for ESM or TS files if ( path &&