Skip to content

Commit dccce59

Browse files
authored
fix(eval): return fallback value (#326)
1 parent c1a24e0 commit dccce59

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/eval.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function evalModule(
1919
ctx: Context,
2020
source: string,
2121
evalOptions: EvalModuleOptions = {},
22-
) {
22+
): any {
2323
// Resolve options
2424
const id =
2525
evalOptions.id ||
@@ -74,7 +74,10 @@ export function evalModule(
7474
).catch((error: any) => {
7575
debug(ctx, "Native import error:", error);
7676
debug(ctx, "[fallback]", filename);
77-
evalModule(ctx, source, { ...evalOptions, forceTranspile: true });
77+
return evalModule(ctx, source, {
78+
...evalOptions,
79+
forceTranspile: true,
80+
});
7881
});
7982
} else {
8083
try {

0 commit comments

Comments
 (0)