Skip to content

Commit 11b29a4

Browse files
committed
Fix issue
1 parent e0a47c2 commit 11b29a4

File tree

1 file changed

+9
-3
lines changed
  • packages/app/src/sandbox/eval/transpilers/babel

1 file changed

+9
-3
lines changed

packages/app/src/sandbox/eval/transpilers/babel/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,15 @@ class BabelTranspiler extends WorkerTranspiler {
5151
const { path } = loaderContext;
5252

5353
if (isESModule(code) && path.indexOf('/node_modules') > -1) {
54-
measure(`es-${path}`);
55-
code = convertEsModule(path, code);
56-
endMeasure(`es-${path}`);
54+
try {
55+
measure(`es-${path}`);
56+
code = convertEsModule(path, code);
57+
endMeasure(`es-${path}`);
58+
} catch (e) {
59+
console.warn(
60+
`Error when converting '${path}' esmodule to commonjs: ${e.message}`
61+
);
62+
}
5763
}
5864

5965
// When we find a node_module that already is commonjs we will just get the

0 commit comments

Comments
 (0)