AndreasMadsen / trace

Creates super long stack traces
https://trace.js.org
MIT License
194 stars 18 forks source link

AsyncWrap init hook threw #19

Closed julien-f closed 8 years ago

julien-f commented 8 years ago

Sometimes I get the error:

FATAL ERROR: node::AsyncWrap::AsyncWrap init hook threw
Aborted

Node v4.2.4 & trace v2.2.0.

AndreasMadsen commented 8 years ago

Try using node 5.3.0 there are some required internal features that node 4.2.4 doesn't have. However I have been promised that they will land in version 4.2.5

julien-f commented 8 years ago

You should:

  1. express this requirement in package.json in the engines.node
  2. maybe even detect this at module startup and throw, because currently there is no way to handle this error and to fail gracefully (i.e. continue without trace).
AndreasMadsen commented 8 years ago

I'm not aware of a syntax that can set independent node version requirements for both v4 and v5. How does that look?

In any case the commits have already landed in v4-staging, so it is a very temporary issue: https://github.com/nodejs/node/pull/3461#issuecomment-167883042

julien-f commented 8 years ago

node: '^4.2.5 || ^5.3' should work.

What about code already using trace but before 4.2.5? Currently the program aborts and it is not handled by a try-catch

AndreasMadsen commented 8 years ago

They should not upgrade to 2.2.x

AndreasMadsen commented 8 years ago

I guess semver was violated to that regard, I'm sorry about that. It is hard to keep track of when trace uses node internal API.

AndreasMadsen commented 8 years ago

I have published:

2.0.2 unfortunately don't have a fix for #17, that is not possible without the new features.

Also, I don't plan to continue doing legacy updates. But hopefully it shouldn't be necessary when 4.2.5 gets released.