aws / aws-xray-sdk-node

The official AWS X-Ray SDK for Node.js.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XRay KOA Library OpenSegment() function type issue in TypeScript

blam135 opened this issue · comments

Hi there,

I noticed that for the XRay Koa Lib, when injecting the openSegment function middleware into a Koa app, it throws a type error in the first screenshot when I do the same thing in a TS file as mentioned in the README.

But after a while digging into it, I realised I needed to type it as Koa.Middleware as shown in the second screenshot. Is it possible we could type this as Koa.Middleware to prevent the need to do app.use(XRayKOA.openSegment('segment') as Koa.Middleware) or update the README to make it clear that this is what should be done on a TS file?

Many thanks :)

image

image

Definitely, thank you for pointing out this issue!

Fixed in PR #525