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

A null shows in the prompt using mqtt.js #1346

Open
muka opened this issue Jan 15, 2024 · 1 comment
Open

A null shows in the prompt using mqtt.js #1346

muka opened this issue Jan 15, 2024 · 1 comment

Comments

@muka
Copy link

muka commented Jan 15, 2024

I found a wired issue which seems to be caused by mqtt.js using typescript

npm i mqtt inquirer@8.2.6
    const askMessage = () => {
      return feature.prompt([
        {
          name: 'message',
          message: 'Your message',
          type: 'input',
        },
      ]);
    };

await askMessage()

image

const client = mqtt.connect('mqtt://test.mosquitto.org')
await askMessage()

image

If mqtt.connect is called, the inquirer prompt will show a null and a new line. Any suggestion on why this may be happening ?

@SBoudrias
Copy link
Owner

Ohh that's weird...

It looks like mqtt is either sending events/data to the process.stdin or is messing with the readline.

I don't see any obvious note on their README, but I'd check for option to either mute the logging or give the tool a different stream to send their writes to.

Waiting for the connection to complete could also help 🤷🏻

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