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

Avoid using Dirent.path and Dirent.parentPath properties #50

Merged
merged 1 commit into from
Dec 21, 2024

Conversation

cmoesel
Copy link
Member

@cmoesel cmoesel commented Dec 21, 2024

Description: Dirent.path was added in Node 18.17.0 and then deprecated in Node 18.20.0. Dirent.parentPath was added in Node 18.20.0. In order to keep compatibility with versions of Node before 18.17.0, don't use Dirent.path or Dirent.parentPath.

Using Dirent.parentPath resulted in errors when SUSHI was run on earlier versions of Node 18.x. See: https://chat.fhir.org/#narrow/channel/215610-shorthand/topic/Issue.20w.2F.20newest.20SUSHI/near/490266928

Testing Instructions: Run npm test on the main branch using a Node 18 version < Node 18.17 (e.g, Node 18.16.0). You will get errors like: TypeError: The "path" argument must be of type string. Received undefined. Now run this PR branch using the same version of Node (e.g., Node 18.16.0). The tests should all pass.

…lable in earlier Node 18.x versions

Dirent.path was added in Node 18.17.0 and then deprecated in Node 18.20.0. Dirent.parentPath was added in Node 18.20.0. In order to keep compatibility with versions of Node before 18.17.0, don't use Dirent.path or Dirent.parentPath.
@cmoesel
Copy link
Member Author

cmoesel commented Dec 21, 2024

Breaking the glass (no peer code reviews) to get this urgent bug fix out ASAP (on the weekend).

@cmoesel cmoesel merged commit 42be1e0 into main Dec 21, 2024
14 checks passed
@cmoesel cmoesel deleted the fix-dirent-bug branch December 21, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant