0

Is it an anti-pattern to use async/await inside of a new Promise() constructor?

I had read this question and answers, but not sure why am I still getting part of the error only and I am sure there are a lot callings. I am not sure what makes the error callstack print to a certain point only.

I am using Node.js 14, here is my sample command:

node --trace-warnings --detailed-error-stack-trace --stack-trace-limit=99999 ./node_modules/.bin/ts-node -r tsconfig-paths/register -T commands/deployment-migrations/migrate.ts

Update:

It is a bug in Node.js 14 https://github.com/nodejs/node/issues/36126

tom10271
  • 4,222
  • 5
  • 33
  • 62

1 Answers1

0

If you really care about the whole error callstack, one of the option is to use Bluebird.

import Promise from 'bluebird';
global.Promise = Promise;
Promise.config({
  longStackTraces: true
});
tom10271
  • 4,222
  • 5
  • 33
  • 62