Skip to content
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

stat method missing from Bun.file types #16417

Open
maccuaa opened this issue Jan 15, 2025 · 1 comment
Open

stat method missing from Bun.file types #16417

maccuaa opened this issue Jan 15, 2025 · 1 comment
Labels
bug Something isn't working types An issue with TypeScript types

Comments

@maccuaa
Copy link

maccuaa commented Jan 15, 2025

What version of Bun is running?

1.1.43+76800b049

What platform is your computer?

Darwin 23.6.0 x86_64 i386

What steps can reproduce the bug?

import { file } from "bun";

const stats = await file("path/to/file").stat();

console.log(stats);

Bun successfully executes this script however the TypeScript compiler is reporting that the stat method does not exist.

error TS2339: Property 'stat' does not exist on type 'BunFile'.

What is the expected behavior?

The bun-types package is updated with the latest features.

What do you see instead?

A typescript error from the bun-types package

Additional information

Using latest @types/bun v1.1.16 that's available in NPM which is using bun-types v1.1.43.

I see the stat method is defined - https://github.com/oven-sh/bun/blob/main/packages/bun-types/bun.d.ts#L1241C3-L1245C4 - so i'm guessing an updated version of bun-types package just needs to be published.

@maccuaa maccuaa added bug Something isn't working types An issue with TypeScript types labels Jan 15, 2025
@RiskyMH
Copy link
Member

RiskyMH commented Jan 15, 2025

Yeah it will be present on next release. You can also install bun-types@canary it you want too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working types An issue with TypeScript types
Projects
None yet
Development

No branches or pull requests

2 participants