microsoft / botbuilder-js

Welcome to the Bot Framework SDK for JavaScript repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using JavaScript.
https://github.com/Microsoft/botframework
MIT License
684 stars 279 forks source link

Cannot bump typescript to 5.6 due to botbuilder `INodeBuffer` error #4746

Closed corinagum closed 1 month ago

corinagum commented 2 months ago

Versions

Botbuilder-js: 4.23.x Node: 18.20.4 Browser: N/A OS: Mac 14.6.x

Describe the bug

When bumping Typescript to 5.6.x in the Teams AI library, typescript errors caught in the latest TS update causes the build to fail due to incorrect extend of Uint8Array. Error message:

 | ../../node_modules/botframework-streaming/lib/interfaces/INodeBuffer.d.ts(15,18): error TS2430: Interface 'INodeBuffer' incorrectly extends interface 'Uint8Array'.
 |   The types returned by 'slice(...)' are incompatible between these types.
 |     Type 'this' is not assignable to type 'Uint8Array'.
 |       Type 'INodeBuffer' is not assignable to type 'Uint8Array'.
 |         The types returned by 'entries()' are incompatible between these types.
 |           Type 'IterableIterator<[number, number]>' is missing the following properties from type 'ArrayIterator<[number, number]>': map, filter, take, drop, and 9 more.

To Reproduce

Steps to reproduce the behavior:

  1. Open any Botbuilder TS sample
  2. In package.json, upgrade typescript to 5.6.x
  3. (If applicable) Remove node_modules/ lock files before building the sample
  4. Install && build the sample
  5. See error in console
tracyboehrer commented 1 month ago

@ceciliaavila Can you comment on this? @corinagum This gets touchy since changing TS version can break people, no?

ceciliaavila commented 1 month ago

@ceciliaavila Can you comment on this? @corinagum This gets touchy since changing TS version can break people, no?

@tracyboehrer, we are currently supporting TS versions from 4.6 to 5.5. Adding support for 5.6 may require some work.

corinagum commented 1 month ago

@tracyboehrer Agreed it is touchy, but I still think we would want to support it.

tracyboehrer commented 1 month ago

@corinagum You aren't wrong. We're going to look into it.

sw-joelmut commented 1 month ago

Hi everyone,

We were able to reproduce the issue using TypeScript 5.6.2 with the ESNext configuration in the tsconfig.json. image

By replacing ESNext with targets prior to that (e.g. ES2023), the issue doesn’t happen. It seems that there is a problem with the TS 5.6 and ESNext combination, because previous versions of TS are working fine. We are working on fixing the errors thrown when using this configuration (TS 5.6 + ESNext target), but, as a workaround, you can change the target to ES2023.