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

mkdir with recursive flag (regression since 1.1.42) throws error when directory exists #16466

Closed
sculpt0r opened this issue Jan 17, 2025 · 4 comments · Fixed by #16464
Closed
Labels
bug Something isn't working

Comments

@sculpt0r
Copy link

sculpt0r commented Jan 17, 2025

What version of Bun is running?

1.1.44+ec11ea4e7

What platform is your computer?

Darwin 24.2.0 arm64 arm / oven/bun:1.1.44

What steps can reproduce the bug?

import {mkdir} from "fs/promises";

await mkdir('cat');
await mkdir('cat', { recursive: true });

What is the expected behavior?

With recursive set on true the error message should not be thrown to the user.

What do you see instead?

EEXIST: file already exists, mkdir 'cat'
    path: "cat",
 syscall: "mkdir",
   errno: -17,
    code: "EEXIST"

Additional information

This works fine in bun:1.1.42.

According to node compatibility: expected behaviour is to not see an error when recursive flag is set.

@sculpt0r sculpt0r added bug Something isn't working needs triage labels Jan 17, 2025
@sculpt0r sculpt0r changed the title mkdir with recursive flag (regression since 1.1.43) mkdir with recursive flag (regression since 1.1.42) throws error when directory exists Jan 17, 2025
@Jarred-Sumner
Copy link
Collaborator

This will be fixed in Bun v1.1.45

@sroussey
Copy link
Contributor

I get the error still in 1.1.45

@Jarred-Sumner Jarred-Sumner reopened this Jan 17, 2025
@Jarred-Sumner
Copy link
Collaborator

the test only covered 2+ levels of directories and not 1-2

@RiskyMH
Copy link
Member

RiskyMH commented Jan 20, 2025

Fixed by @dylan-conway in #16497. The fix will be included in Bun v1.1.46 which releases very soon.

You can also try update via canary bun upgrade --canary if can't wait

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

Successfully merging a pull request may close this issue.

4 participants