Work around issue with Node 22 and Jiti (#15421)

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.
This commit is contained in:
Jordan Pittman
2024-12-17 13:43:33 -05:00
committed by GitHub
parent 7d6b854a72
commit 0e36bec701
+4
View File
@@ -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 &&