You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript is able to properly identify the CommonJS version of the Middy package that is available.
Environment (please complete the following information):
Node.js: 18
Middy: 4.6.2
AWS SDK: N/A
Additional context
See details in the README of [this demo repo](I've outlined the details of what I am seeing in this repo.
The potential fix I outline in the README seems pretty simple -- my suggestion is to introduce an index.d.cts type definitions file (note the .cts extension) which seems to give TypeScript the kick in the butt it needs to properly identify the CommonJS version of the package.
Ancillary to this...others are having issues with building "hybrid" packages with TypeScript 5.2.2. Middy doesn't seem impacted by that though since it's not actually written in TypeScript; instead, it is just helpful by including type definitions 🙂
The text was updated successfully, but these errors were encountered:
Also worth noting that I am happy to PR -- would just want some guidance on how Middy's build process works and how to introduce an index.d.cts file into it.
Thanks for reporting with an example. Since we're planning to drop cjs support in the next version of Middy soon (just waiting on the next lambda runtime to be released ... maybe Nov). We're having enough trouble maintaining one set of types, let alone two. So, I'm going to have to say we're not going to make changes to support this. Sorry.
Two options:
a) lock the version of TypeScript to an older one that works with Middy
b) Report issue to the TypeScript team to resolve on their end
Describe the bug
The latest version of TypeScript (5.2.2) has problems correctly identifying the CommonJS version of Middy that is available in the package.
I've outlined the details of what I am seeing in this demo repo
To Reproduce
See the Demo Problem Using This Repo section of the README of my repo linked above.
Expected behaviour
TypeScript is able to properly identify the CommonJS version of the Middy package that is available.
Environment (please complete the following information):
Additional context
See details in the README of [this demo repo](I've outlined the details of what I am seeing in this repo.
The potential fix I outline in the README seems pretty simple -- my suggestion is to introduce an
index.d.cts
type definitions file (note the .cts extension) which seems to give TypeScript the kick in the butt it needs to properly identify the CommonJS version of the package.Ancillary to this...others are having issues with building "hybrid" packages with TypeScript 5.2.2. Middy doesn't seem impacted by that though since it's not actually written in TypeScript; instead, it is just helpful by including type definitions 🙂
The text was updated successfully, but these errors were encountered: