Skip to content

ts: typesWithBodyKey no longer exists #2835

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
bkuster opened this issue May 14, 2025 · 3 comments
Closed

ts: typesWithBodyKey no longer exists #2835

bkuster opened this issue May 14, 2025 · 3 comments

Comments

@bkuster
Copy link

bkuster commented May 14, 2025

Regression report

No longer able to build TS project after update to 9: Cannot find module './lib/api/typesWithBodyKey' or its corresponding type declarations. Quick look at the package: the file no longer exists.

Update: Deleting the line from the index.d.ts manually does the trick.

Last working version

8.18.2

To reproduce

create a file foo.ts

import { Client } from '@elastic/elasticsearch';

run

npx tsc foo.ts

Expected behavior

i expect this to build

Node.js version

20.18.3

TypeScript version

5.8.3

Elasticsearch client version

9.0.1

Elasticsearch server version

9.0.1

Operating system

Debian

Any other relevant environment information.

No response

@JoshMock
Copy link
Member

This is mentioned in the 9.0 breaking changes, at least indirectly. typesWithBodyKey is indeed no longer supported and that is intentional.

I've updated the breaking changes does in #2839 to mention this more explicitly. If you need typesWithBodyKey, it is suggested to keep using an 8.x client until you are ready to remove its usage.

@JoshMock JoshMock closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2025
@bkuster
Copy link
Author

bkuster commented May 20, 2025

@JoshMock: you misunderstood, let me be more blunt:

I dont wish to use the typesWithBodyKey YOUR packaged release still tries to export a missing file.

In other words, you missed a spot.

@JoshMock
Copy link
Member

Got it, misunderstood what you meant. That was actually in #2821 recently but a patch release has not been published since then. I'll publish 9.0.2 today with that fix.

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

No branches or pull requests

2 participants