We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5acc437 commit 4c18a20Copy full SHA for 4c18a20
nodejs/packages/layer/src/loader.mjs
@@ -76,7 +76,16 @@ export function registerLoader() {
76
}
77
78
79
-if (_isHandlerAnESModule()) {
+function _getNodeRuntimeVersion() {
80
+ const executionEnv = process.env.AWS_EXECUTION_ENV || '';
81
+ const match = executionEnv.match(/nodejs(\d+)\.x/);
82
+ if (!match) {
83
+ return undefined;
84
+ }
85
+ return Number(match[1]);
86
+}
87
+
88
+if (_isHandlerAnESModule() || _getNodeRuntimeVersion() >= 24) {
89
/*
90
We could activate ESM loader hook of the "import-in-the-middle" library,
91
- by "--loader=import-in-the-middle/hook.mjs" Node CLI option, but "--loader" option has been deprecated
0 commit comments