0

I've got a weird issue going on. I have a node service being started with yarn .... The app seems to work fine for some random amount of time before I get hit with a...

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

There is no error logged. My service already has the following two handlers, but they never log anything when the service dies like this.

process.on('unhandledRejection', (err: any) => {
    logger.fatal({ err: err }, 'Process failed. Unhandled Rejection');
  });

  process.on('uncaughtException', (list) => {
    logger.fatal({ err: list }, 'unhandledExceptionThrown');
  });

I've read some other SO question (error Command failed with exit code 1. when I try to run yarn) and tried to clear node modules / clean my yarn cache, but so far that has not helped the issue.

Is there something else I can try to track down what's causing the issue?

Scalahansolo
  • 2,615
  • 6
  • 26
  • 43

1 Answers1

0

After lots of digging around, I found something that was able to help move me in the right direction. Im not sure why the handlers above weren't catching the issue, however... when I added --unhandled-rejections=strict to my node command to start the service, the app would blow up as expected and actually would output some useful information.

Scalahansolo
  • 2,615
  • 6
  • 26
  • 43