-
Notifications
You must be signed in to change notification settings - Fork 15k
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
[Bug]: v29 fs
module fails to recognize files containing emojis on Windows
#41484
Comments
Hello @brianpetro. Thanks for reporting this and helping to make Electron better! Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use. Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests. Now adding the
blocked/need-repro
|
This is a problem of the fs module and encodings. Electron has nothing to do with it. |
@Rn145 are you sure about that? Why would changing from electron 28 to electron 29 cause the issue, with the same node and presumably |
I can't say anything about switching to another version of Electron. But on a simple script for Node.js (version 20.11.1) I have the same problem with emoticons. const fs = require('fs');
const files = fs.readdirSync(".");
files.forEach((filename, i)=>{
console.log(filename, fs.existsSync(filename));
}); If he does not accept the filenames that he returned, then this is at least strange. |
@brianpetro |
@Rn145 thanks for your help in getting to the bottom of this. What are the implications? Is this going to remain broken in Electron versions that use the affected node versions? |
@Rn145 Thanks so much for hunting down the root cause in Node, very appreciated! 🙇♀️ @brianpetro Thanks for the original issue report - I'll see what the status is for getting this fixed in Node 20 LTS, in which case we can update to the fixed version. We could possibly cherry-pick or patch in the libuv fix if needed, we just try to avoid drift with upstream dependencies when we can. I'll check on this and report back. |
See #41673 |
@codebytere the PR was merged, can this be closed as well? |
Closed in #41673 |
Preflight Checklist
Electron Version
29
What operating system are you using?
Windows
Operating System Version
10
What arch are you using?
x64
Last Known Working Electron version
28
Expected Behavior
fs.existsSync
should return true for file paths containing emojis.Actual Behavior
fs.readdirSync
lists files with the emojis; however, callingfs.existsSync
fails for the same files.Testcase Gist URL
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: