Comments (8)
Hi, this is unlikely an issue coming from inquirer. Do you have code example?
from inquirer.js.
mainMenu function
async function mainMenu(){
child_process.execSync('cls');
await db.prepare('CREATE TABLE IF NOT EXISTS lang (value TEXT)').run();
var langData = await db.prepare('SELECT * FROM lang').get();
if(langData)lang.setLang(langData.value);
if(!langData){
var newLang = await setNewLanguage();
await db.prepare('INSERT INTO lang (value) VALUES (?) ').run(newLang);
lang.setLang(newLang);
};
var mainMenu = await select({
message: lang.getText('main_menu'),
theme:{ icon: { cursor: '=>' }},
loop: false,
choices: getChoices(arr)
});
import(`./events/${mainMenu}.mjs`);
// arr.push(mainMenu);
};
selected list function
import { returnMainMenu, lang, setNewLanguage } from '../cli.js';
import db from '../services/database.js';
import child_process from 'child_process';
const select_new_lang = async () => {
var newLang = await setNewLanguage();
await db.prepare('UPDATE lang SET value = ? ').run(newLang);
lang.setLang(newLang);
child_process.execSync('cls');
return returnMainMenu();
};
select_new_lang();
return mainMenu function
async function returnMainMenu(){
child_process.execSync('cls');
var value = await select({
message: lang.getText('return_to_main_menu'),
choices: [
{name:lang.getText('yes'),value:'return'},
{name:lang.getText('no'),value:'exit'}
]
});
if(value == 'exit')child_process.execSync('exit');
if(value == 'return')mainMenu();
};
from inquirer.js.
20240216-2103-14.4707216.mp4
from inquirer.js.
from inquirer.js.
Hi @Bes-js, there's a lot going on there.
What might help you is to simplify the case. Only make a recursive prompt with inquirer - see it works. Then add pieces by pieces and you'll likely find out where it breaks.
from inquirer.js.
When I opened a new project and tried just select from scratch, the same problem occurred again.
from inquirer.js.
It looks like a problem with the package, but when I tried such things in other languages it didn't cause any problems.
from inquirer.js.
Can you share your new project reproduction so I can run it?
from inquirer.js.
Related Issues (20)
- Bump `yoctocolors-cjs` to `2.1.2` for Deno compatibility HOT 4
- Possible bug on using inquirer inside of commitlint HOT 1
- High Severity ReDoS vulnerability in ansi-regex HOT 2
- Date prompt HOT 3
- New set implementation errors when overriding a boolean with an object HOT 3
- instanceof always returning false when checking for ExitPrompError errors HOT 5
- Program cannot be killed on powershell using Ctrl+c HOT 1
- prompt list returns undefined HOT 3
- Load more/append to list HOT 11
- [Feature]: inquirer/search - external pagination support (or be able to pass search value back to new instance) HOT 3
- [Feature]: inquirer/search - debounce support HOT 4
- How to get "Choice" type? HOT 8
- Guidance for unit tests HOT 2
- Ctrl+C breaks my terminal with "nested" prompts HOT 4
- Which version of @inquirer/prompts supports Node.js v16? HOT 1
- `[email protected]` has a missing type for `message` in prompt function HOT 6
- A way to fix flickering HOT 2
- Reuse prompt? HOT 3
- Handle ctrl+c gracefully HOT 4
- Proper text search in select? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inquirer.js.