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

Program does not work until restart after stopped with ctrl + c #44363

Closed
JanCantCode opened this issue Aug 23, 2022 · 4 comments
Closed

Program does not work until restart after stopped with ctrl + c #44363

JanCantCode opened this issue Aug 23, 2022 · 4 comments

Comments

@JanCantCode
Copy link

JanCantCode commented Aug 23, 2022

Version

v18.2.0

Platform

Linux pi 5.4.79-v7l+ #1373 SMP Mon Nov 23 13:27:40 GMT 2020 armv7l GNU/Linux (i have tried it on WINDOWS but encountered the same problem)

Subsystem

No response

What steps will reproduce the bug?

install the package
"kahoot.js-latest"

(this is the code i use, might work with different code aswell)

try {
    const Kahoot = require("kahoot.js-latest")
    const client = new Kahoot()



    client.join(773560, "einRandomBot")
    } catch (e) {
        print("crash")
    }

How often does it reproduce? Is there a required condition?

Everytime the programm is run after beeing stopped once

What is the expected behavior?

The programm should run succesfully

What do you see instead?

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Additional information

i can run the programm once successfully, but as soon as i stop the programm with ctrl and c, and try to start it again, i get the error

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

when i restart my machine, it suddenly starts working again for once.

@mscdex
Copy link
Contributor

mscdex commented Aug 24, 2022

Sounds like something you should take up with the maintainer of that module?

@JanCantCode
Copy link
Author

try {
    const Kahoot = require("kahoot.js-latest")
    const client = new Kahoot()



    client.join(773560, "einRandomBot")
    } catch (e) {
        print("crash")

i just had no idea what this could potentially be caused by.. im gonna try to contact him tho

@MoLow
Copy link
Member

MoLow commented Aug 24, 2022

i just had no idea what this could potentially be caused by.. im gonna try to contact him tho

you can catch the execption with https://nodejs.org/api/process.html#event-uncaughtexception and see the stack trace

@tniessen tniessen changed the title Programm doesnt work until restart after stopped with ctrl + c Program does not work until restart after stopped with ctrl + c Aug 26, 2022
@bnoordhuis
Copy link
Member

Looks like there is no reason to believe this is an issue with Node.js itself? I'll go and close this out.

@bnoordhuis bnoordhuis closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2022
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

4 participants