Uh oh!
There was an error while loading. Please reload this page.
module: fix EISDIR error with Windows drive-letter-only paths - #60438
module: fix EISDIR error with Windows drive-letter-only paths#60438ThierryMT wants to merge 2 commits into
Conversation
When using cork() and uncork() with ServerResponse, the drain event was not reliably emitted after uncorking. This occurred because the uncork() method did not check if a drain was pending (kNeedDrain flag) after flushing the chunked buffer. This fix ensures that when uncork() successfully flushes buffered data and a drain was needed, the drain event is emitted immediately. Fixes: nodejs#60432
When Windows long paths with \\?\ prefixes are processed during module resolution, the path can sometimes be reduced to just a drive letter (e.g., 'C:'), which causes fs.realpathSync to fail with EISDIR. This adds validation in toRealPath() to detect drive-letter-only paths and append a backslash to make them valid before calling realpathSync. Note: This addresses the immediate symptom. The root cause of why paths are being reduced to drive letters needs further investigation. Fixes: nodejs#60435
nodejs-github-bot
commented
Oct 27, 2025
Review requested:
|
aduh95
commented
Oct 27, 2025
Can you add a test that fails without this patch and pass with it? |
Hritikk999
commented
Oct 28, 2025
Okay commit node.js |
| if (ret && this[kNeedDrain]) { | ||
| this[kNeedDrain] = false; | ||
| this.emit('drain'); | ||
| } |
There was a problem hiding this comment.
@ThierryMT it looks like these are the changes from #60437, which I think aren't directly related to this change.
Can you remove these HTTP changes so we can handle them separately in that other PR?
StefanStojanovic
commented
Oct 28, 2025
@ThierryMT, how is the change from |
This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open. |
Fixes#60435⚠️ This fix was developed on Linux and has not been tested on Windows. Windows testing is needed to verify the fix works correctly with long paths using the \?\ prefix. Additional Context: This fix addresses the immediate symptom. The root cause of why paths are being reduced to just drive letters during processing needs further investigation. ``
When Windows long paths with ?` prefixes are processed during module resolution, the path can sometimes be reduced to just a drive letter (e.g., 'C:'), which causes fs.realpathSync() to fail with EISDIR: illegal operation on a directory. The Fix: This adds validation in toRealPath() to detect drive-letter-only paths and append a backslash to make them valid ('C:') before calling realpathSync(). Changes: - Modified lib/internal/modules/helpers.js - Added Windows-specific check in toRealPath() function Testing Note: