Skip to content

Commit

Permalink
module: cjs-module-lexer WebAssembly fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jun 29, 2022
1 parent ea99431 commit a522525
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/internal/modules/esm/translators.js
Expand Up @@ -61,8 +61,13 @@ async function initCJSParse() {
} else {
const { parse, init } =
require('internal/deps/cjs-module-lexer/dist/lexer');
await init();
cjsParse = parse;
try {
await init();
cjsParse = parse;
}
catch {
cjsParse = require('internal/deps/cjs-module-lexer/lexer').parse;
}
}
}

Expand Down

0 comments on commit a522525

Please sign in to comment.