Restore Node 24 (and before) behavior as fs.existsSync() now throws deprecation warning#474
Open
kroh wants to merge 1 commit into
Open
Restore Node 24 (and before) behavior as fs.existsSync() now throws deprecation warning#474kroh wants to merge 1 commit into
kroh wants to merge 1 commit into
Conversation
…en passed invalid undefined/objects
👷 Deploy request for lando-core pending review.Visit the deploys page to approve it
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
Execution of lando results in the following error:
What was wrong
Node 24 introduced deprecation DEP0187:
fs.existsSync()now warns when passed anything that isn't a string/Buffer/URL. Older Node silently returned false. Lando relies on that old behavior in many places — it callsfs.existsSync(x)where x is often undefined or an object (e.g. plugin dirs that don't exist, config source objects). Each command bootstraps different subsystems, so different call sites fired.The fix
Rather than guard dozens of individual call sites (fragile and incomplete), I added a single global shim at Lando's entry point at @lando/core/bin/lando:
This restores the pre-Node-24 semantics (non-path argument returns false), so behavior is unchanged, just no warning.