Skip to content

Commit

Permalink
Work around issue with Node 22 and Jiti (#15421)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thecrypticace authored Dec 17, 2024
1 parent f875ab9 commit 0a836f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/load-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 0a836f7

Please sign in to comment.