davidmarkclements / cute-stack

Cute up your stack traces in Node
82 stars 6 forks source link

substring issue causing crash on server #19

Open spkellydev opened 5 years ago

spkellydev commented 5 years ago

I apologize for my code formatter messing with some spacing and formatting, but this PR is in response to #13 wherein cute-stack needs to be required after the server starts. This wasn't a possibility in my Typescript project, so I looked into the issue. It appears the problem comes from the script not being loaded before cute() runs.

Otherwise, maybe it's possible to use Node's new AsyncResource in this scope? https://github.com/nodejs/node/blob/master/doc/api/async_hooks.md#new-asyncresourcetype-options