Repository navigation
fix(ext/node): return first created path from recursive "node:fs" mkdir call - #32300
Merged
bartlomieju merged 12 commits intoMar 2, 2026
Merged
bartlomieju merged 12 commits into
bartlomieju merged 12 commits into
Conversation
Node's `fs.mkdir()` with `{ recursive: true }` should return the path of
the first directory created, or `undefined` if no directory was created.
Deno's polyfill was always returning `undefined`. This fixes the callback,
sync, and promise-based APIs.
Closes denoland#24165
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
I think based on the changes we could try to enable this test: |
Member
Author
|
Good call, sadly still fails: |
Tango992
suggested changes
Feb 25, 2026
Tango992
left a comment
Contributor
There was a problem hiding this comment.
I have some minor suggestions that (probably) could make the node compat test work
Co-authored-by: Daniel Osvaldo Rahmanto <daniel.rahmanto@gmail.com> Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Daniel Osvaldo Rahmanto <daniel.rahmanto@gmail.com> Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Daniel Osvaldo Rahmanto <daniel.rahmanto@gmail.com> Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Tango992
approved these changes
Feb 26, 2026
Tango992
left a comment
Contributor
There was a problem hiding this comment.
Well I guess the node test won't work😂. Let's just revert the commit and merge it
Contributor
|
Edited the node compat test config to ignore |
Member
Author
|
I want to give it one more try on Windows before ignoring |
On Windows, `mkdir` through a file path returns EEXIST instead of ENOTDIR. This adds a fixup that detects when a path component is a file and remaps the error code to match Node.js behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
|
@Tango992 cheers, it appears to work now |
bartlomieju
enabled auto-merge (squash)
March 2, 2026 10:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fs.mkdir(),fs.mkdirSync(), andfs/promises.mkdir()with{ recursive: true }to return the first directory path created, matching Node.js behaviorundefinedtest-fs-mkdir.jsNode compat testCloses #24165