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

TypeError in Deno.stat on Windows with exFAT-formatted drives #27286

Open
mono0x opened this issue Dec 9, 2024 · 1 comment
Open

TypeError in Deno.stat on Windows with exFAT-formatted drives #27286

mono0x opened this issue Dec 9, 2024 · 1 comment
Labels
bug Something isn't working correctly ext/fs

Comments

@mono0x
Copy link

mono0x commented Dec 9, 2024

  • Deno Version: 2.1.3
  • Operating System: Windows 11 Pro 24H2

Running a script using Deno.stat on a file located on an exFAT-formatted drive (e.g. SD card) causes a TypeError: Cannot convert a BigInt value to a number. The issue does not occur on NTFS-formatted drives. Additionally, the issue could not be reproduced on macOS Sequoia 15.1.1 when performing the same steps.

Steps to Reproduce

  1. Prepare an exFAT-formatted drive (e.g., G:\ drive).
  2. Create a test file test.txt on the drive:
    touch G:\test.txt
    
  3. Create a test script test.ts with the following content:
    console.log(await Deno.stat("G:\\test.txt"));
  4. Execute the script with the necessary permission:
    deno run --allow-read test.ts
    

Actual Behavior

The following error occurs:

error: Uncaught (in promise) TypeError: Cannot convert a BigInt value to a number
console.log(await Deno.stat("G:\\test.txt"));
            ^
    at new Date (<anonymous>)
    at parseFileInfo (ext:deno_fs/30_fs.js:381:41)
    at Object.stat (ext:deno_fs/30_fs.js:410:10)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async file:///C:/path/to/test.ts:1:13

Expected Behavior

The script should output the file information without throwing an error.

@mono0x mono0x changed the title TypeError in Deno.stats with Windows and exFAT-formatted drives TypeError in Deno.stat with Windows and exFAT-formatted drives Dec 9, 2024
@mono0x mono0x changed the title TypeError in Deno.stat with Windows and exFAT-formatted drives TypeError in Deno.stat on Windows with exFAT-formatted drives Dec 9, 2024
@dsherret dsherret added bug Something isn't working correctly ext/fs labels Dec 9, 2024
@mono0x
Copy link
Author

mono0x commented Dec 12, 2024

This problem seems to have started from Deno 2.1. There is no error in Deno 2.0.6 and have occured the error in Deno 2.1.0.

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

No branches or pull requests

2 participants