-
-
Notifications
You must be signed in to change notification settings - Fork 260
Open
Description
index.ts:
import ora from 'ora'
const spinner = ora('Starting...').start()
spinner.succeed('Done!')
run tsup index.ts --format cjs,esm && node dist/index.js
and get error:
var import_ora = __toESM(require("ora"));
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/zhangjiawei/Desktop/github-downloader/node_modules/.pnpm/ora@6.1.0/node_modules/ora/index.js from /Users/zhangjiawei/Desktop/github-downloader/dist/index.js not supported.
Instead change the require of /Users/zhangjiawei/Desktop/github-downloader/node_modules/.pnpm/ora@6.1.0/node_modules/ora/index.js in /Users/zhangjiawei/Desktop/github-downloader/dist/index.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/Users/zhangjiawei/Desktop/github-downloader/dist/index.js:47:26) {
code: 'ERR_REQUIRE_ESM'
}
yovanoc, yunsii and charlie632
Metadata
Metadata
Assignees
Labels
No labels