Skip to content

Commit 2aafded

Browse files
andybeefilmaj
authored andcommitted
fix for ESM import issue in Node 20.19+
1 parent e4b25ec commit 2aafded

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/input-handler.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ async function getMod (filepath) {
158158

159159
try {
160160
mod = require(filepath)
161+
if (process?.features?.require_module === true && mod.default) {
162+
mod = mod.default
163+
}
161164
}
162165
catch (err) {
163166
if (hasEsmError(err)) {

0 commit comments

Comments
 (0)