-
Notifications
You must be signed in to change notification settings - Fork 70
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
oclif incompatible with inquirer 9 - prompting guide broken #476
Comments
Any news on that issue ? |
Seeing the same thing as I attempt to use the latest version of |
The reason is, pretty sure, that I also struggle to move our cli to ESM to make the latest inquirer work, and also Any help or guide on how to migrate a CLI project to ES Modules would be highly appreciated, especially when aslo using typescript. #256 seems also to talk about that topic |
I was facing the below issue
and had to resolve also by rolling back to inquirer@8 and @types/inquirer@8 |
1 year, guide is still broken. Adding package version to the guide would mitigate this issue. |
Hey all, sorry we missed this issue. As pointed above, inquirer fully moved to ESM in v9. The current example works in an ESM plugin but we added a new one for CJS CLIs that still want to use latest inquirer: |
Describe the bug
Disclaimer: I'm unsure which of the projects actually contains this bug, but here goes.
I'm trying out oclif version oclif/3.1.2 darwin-x64 node-v18.7.0 following the documentation on prompts.
I've copied line by line from the example in the docs installing inquirer and types defs for version 9.1.0.
This results in a whole sequence of issues:
This is solved by replacing the import statement from
import * as inquirer from 'inquirer'
toimport inquirer from 'inquirer'
However, changing the import statement followed by a yarn prepack results in the following error
Inquirer is a pure ESM project since version 9.
I tried following the typescript guide on how to convert from commonjs til module, however this introduces a whole range of other issues with the entire project
My current solution is to roll back to
inquirer@8
and@types/inquirer@8
. But that prevents any future patches from inquirer and all of the cool inquirer plugins :-(To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should work with inquirer.js 9+
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: