From dccce59504d0f8350b9154f908246ce554183c39 Mon Sep 17 00:00:00 2001 From: Lars Kappert Date: Mon, 7 Oct 2024 17:49:45 +0200 Subject: [PATCH] fix(eval): return fallback value (#326) --- src/eval.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/eval.ts b/src/eval.ts index 4be48cf6..9cd80dd4 100644 --- a/src/eval.ts +++ b/src/eval.ts @@ -19,7 +19,7 @@ export function evalModule( ctx: Context, source: string, evalOptions: EvalModuleOptions = {}, -) { +): any { // Resolve options const id = evalOptions.id || @@ -74,7 +74,10 @@ export function evalModule( ).catch((error: any) => { debug(ctx, "Native import error:", error); debug(ctx, "[fallback]", filename); - evalModule(ctx, source, { ...evalOptions, forceTranspile: true }); + return evalModule(ctx, source, { + ...evalOptions, + forceTranspile: true, + }); }); } else { try {