davidbanham / express-async-errors

async/await support for ExpressJS
Other
891 stars 42 forks source link

Doesnt weem to work when using babel presets #2

Closed bobmoff closed 6 years ago

bobmoff commented 6 years ago

tried with stage-2, stage-1 och stage-0 and also es2015..

if any of those is used, this module doesnt work

i switched back to only specifically use object-rest-spread plugin (which was what i was only using any way) and then it works

any idea of why this might be ?

bobmoff commented 6 years ago

very nice module by the way 👍

davidbanham commented 6 years ago

Hi Bob, thanks! I don't use babel much at all, so I can't be sure what's happening, I'm afraid.

My hip-shot guess is that it's transforming the promises and async functions around but has no way to transform the checks for .catch which then fail.

Which, if that's actually the case, might be solved by the suggestion in #1

Would you mind grabbing that branch and testing it out with your babel pipeline?

npm install express-async-errors@assume-promise should do it

scottmas commented 6 years ago

Try it with the latest. We do a little more robust job of monkey patching the route handler.

scottmas commented 6 years ago

Feel free to re-open this if you still have issues.

bobmoff commented 6 years ago

tried it with the latest version and it works great, thx!