-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 Report #2796
Comments
Congratulations on making your first Issue! 🎊 If you haven't already, check out our Contributing Guidelines and Issue Reporting Guidelines to ensure that you are following our guidelines for contributing and making issues. |
|
Yes, I’d like to work on this issue! Could you please assign it to me? I’ll ensure the solution works across macOS, Linux, and Windows. Additionally, I’ll write tests to prevent this issue from recurring. Looking forward to contributing! |
I don't get this error, everything works fine for me, are u working in |
This error occurs particularly on windows. |
Thanks. Your solution mustn't break it's functionality with other operating systems |
Describe the bug
When running the script to list sample data files, it fails with the following error:
Error listing sample data: Error: ENOENT: no such file or directory, scandir 'C:\C:\Shreyas\Project\talawa-api\sample_data'
The issue appears to stem from an incorrectly resolved file path, where an extra C:\ is added to the start of the path.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The script should successfully locate and list the .json files in the sample_data directory and display their document counts.
Actual behavior
The script fails to locate the directory due to an incorrectly resolved path:
C:\C:\Shreyas\Project\talawa-api\sample_data
Screenshots
![image](https://private-user-images.githubusercontent.com/78013060/398937150-a60f78b5-a698-4a08-b4bd-1f4712a4c29a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjkxMjYsIm5iZiI6MTczOTI2ODgyNiwicGF0aCI6Ii83ODAxMzA2MC8zOTg5MzcxNTAtYTYwZjc4YjUtYTY5OC00YTA4LWI0YmQtMWY0NzEyYTRjMjlhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDEwMTM0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNmNjFjNjc5NzYwYmJjY2YyNzdhNDMwZTMyMTNmMTgxM2YyZTRkYjgxZTUxZTcxODZhMmU4ODdjOGU4ZGZmNWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-HeERYjFhwC9KGwjgxaCo2Gn7YnCf_6-fu6W2DLk-lk)
Additional details
The issue is likely caused by the resolution of import.meta.url to a filesystem path. This behavior is inconsistent across operating systems, particularly on Windows.
The dirname calculation may need an update to handle the leading / or file:/// prefix correctly.
Potential internship candidates
Please read this if you are planning to apply for a Palisadoes Foundation internship
The text was updated successfully, but these errors were encountered: