Closed devinrhode2 closed 2 years ago
I will keep this open, in case someone wants to pull this into the readme
Great example; thanks for raising it!
The top-level await
makes me wonder if this library should support async constructors - but I suspect that will cause unexpected timing issues with synchronous requires/patching.
Looking at https://github.com/ovhemert/pino-applicationinsights/blob/master/src/index.js specifically, I'm unsure why its marked as async
- it doesn't appear to actually await
or return a Promise.
Ok, turns out .mjs files are NOT supported by cosmic config https://github.com/davidtheclark/cosmiconfig/issues/224
@atkinchris I noticed that same exact thing and raised an issue here: https://github.com/ovhemert/pino-applicationinsights/issues/56
For now it was pretty easy to use patch-package and just delete the async
keyword 😄 🎉
Side note - something I noticed, I think with next, is that all exceptions that happen in an api route end up being funneled into console.error in some way.
Just wanted to share this example:
I'm using this tsconfig, typescript 4.5.5
Versions:
However, only these three need to appear in your package.json:
pino
andapplication-insights
are already included in these packages.Lastly, my package.json scripts entry: