diff --git a/bin/main.js b/bin/main.js index 3c6585776f..76fa6c0783 100644 --- a/bin/main.js +++ b/bin/main.js @@ -180,7 +180,7 @@ export async function main(nodeProcess) { // try require for json markedConfig = require(configFile); } catch(err) { - if (err.code !== 'ERR_REQUIRE_ESM') { + if (err.code !== 'ERR_REQUIRE_ESM' && err.code !== 'ERR_REQUIRE_ASYNC_MODULE') { throw err; } // must import esm diff --git a/test/unit/bin.test.js b/test/unit/bin.test.js index 30fa726674..e0b2bf718b 100644 --- a/test/unit/bin.test.js +++ b/test/unit/bin.test.js @@ -116,6 +116,11 @@ describe('bin/marked', () => { stdout: '
line1
line2
line1
line2