Skip to content

Compatibility with TypeScript 5.7 (array buffers) #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ehoogeveen-medweb opened this issue Nov 25, 2024 · 3 comments · Fixed by #54
Closed

Compatibility with TypeScript 5.7 (array buffers) #53

ehoogeveen-medweb opened this issue Nov 25, 2024 · 3 comments · Fixed by #54

Comments

@ehoogeveen-medweb
Copy link

Disclaimer: TypeScript 5.7 was only just released and I'm not trying to rush you.

TypeScript 5.7 includes some changes to how array buffers are typed, and it appears that better-typescript-lib will need to be updated to be compatible with it.

With TypeScript 5.7.2 and better-typescript-lib 2.9.0 and compiling the following file:

import * as zlib from 'node:zlib'

const result = zlib.gzipSync("test");

console.log(result.byteLength);

I get this error:

src/test.ts:5:20 - error TS2339: Property 'byteLength' does not exist on type 'Buffer<ArrayBufferLike>'.

Without better-typescript-lib there's no error.

reproduction repository

@uhyo
Copy link
Owner

uhyo commented Nov 25, 2024

Yes, I need to work on TS 5.7 support. Thank you for a reminder 🙂

Installing better-typescript-lib 2.9.0 essentially keeps you on TS 5.6's type definitions despite actually using TS 5.7.

I believe @types/node now utilizes typesVersions to provide different definitions for TS <= 5.6 and 5.7, which is problematic in this case.

Sorry for inconvenience until I release a new version. 🙇

@uhyo
Copy link
Owner

uhyo commented Dec 1, 2024

@ehoogeveen-medweb I just released a new version of better-typescript-lib which should be TS 5.7 compatible. Please try 🙂

@ehoogeveen-medweb
Copy link
Author

Everything is working with 2.10.0 and TS 5.7, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants