Skip to content

Commit f68eac1

Browse files
jimsalyerJim Salyer
andauthored
Fix ESM lambda path on Windows (#234)
* handle ESM lambda path on Windows --------- Co-authored-by: Jim Salyer <jim.salyer@efleets.com>
1 parent d406fcc commit f68eac1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lambdalocal.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,9 @@ function _executeSync(opts) {
206206
callbackWaitsForEmptyEventLoop = false;
207207
}
208208

209-
if (lambdaPath){
210-
lambdaPath = utils.getAbsolutePath(lambdaPath);
209+
if (lambdaPath) {
210+
const esmWindows = esm && process.platform === 'win32';
211+
lambdaPath = (esmWindows ? 'file://' : '') + utils.getAbsolutePath(lambdaPath);
211212
}
212213

213214
// set environment variables before the require

0 commit comments

Comments
 (0)