Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide ESM package for cli development #358

Open
HerbertHe opened this issue Mar 9, 2022 · 1 comment
Open

provide ESM package for cli development #358

HerbertHe opened this issue Mar 9, 2022 · 1 comment

Comments

@HerbertHe
Copy link

Is your feature request related to a problem?

Ex. I'm always frustrated when I try to write a cli tool. With the development of nodejs, ESM has been supported, more and more packages only support ESM format importing now. So, here I got the following error, when I try to run the built cli tool.

file:///F:/Projects/cli/bin/cli.mjs:27
  throw new Error('Dynamic require of "' + x + '" is not supported');
        ^

Error: Dynamic require of "readline" is not supported
    at file:///F:/Projects/cli/bin/cli.mjs:27:9
    at node_modules/.pnpm/[email protected]/node_modules/prompts/lib/elements/prompt.js (file:///F:/Projects/cli/bin/cli.mjs:3130:20)
    at __require2 (file:///F:/Projects/cli/bin/cli.mjs:33:50)
    at node_modules/.pnpm/[email protected]/node_modules/prompts/lib/elements/text.js (file:///F:/Projects/cli/bin/cli.mjs:3193:18)
    at __require2 (file:///F:/Projects/cli/bin/cli.mjs:33:50)
    at node_modules/.pnpm/[email protected]/node_modules/prompts/lib/elements/index.js (file:///F:/Projects/cli/bin/cli.mjs:4976:19)
    at __require2 (file:///F:/Projects/cli/bin/cli.mjs:33:50)
    at node_modules/.pnpm/[email protected]/node_modules/prompts/lib/prompts.js (file:///F:/Projects/cli/bin/cli.mjs:4995:14)
    at __require2 (file:///F:/Projects/cli/bin/cli.mjs:33:50)
    at node_modules/.pnpm/[email protected]/node_modules/prompts/lib/index.js (file:///F:/Projects/cli/bin/cli.mjs:5059:20)

Describe the solution you'd like

Maybe the ESM format package was exported would fix this error?

@gfortaine
Copy link

#384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants