Repository navigation
fix(cli): --variables-file reads the file instead of failing with io.readFile is not a function - #6591
Open
cathrynlavery wants to merge 3 commits into
Open
fix(cli): --variables-file reads the file instead of failing with io.readFile is not a function#6591cathrynlavery wants to merge 3 commits into
cathrynlavery wants to merge 3 commits into
Conversation
This was referenced Oct 28, 2026
This branch has not been deployed
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.
What
In 0.8.209,
--variables-filefails onrender,lambda render,cloudrunandcloud render:With this change,
readJsonFlagTextuses its default reader whenever a caller passesundefinedforreadFileorreadStdin.Why
resolveVariablesArgcallsparseVariablesArg(inline, filePath)without readers, andparseVariablesArgforwards{ readFile, readStdin }, bothundefined, toreadJsonFlagText. There,{ ...defaultIO, ...partialIo }copies theundefinedvalues over the defaults. Every existing test injects a reader, so none of them reached the default.To reproduce on 0.8.209, in any project:
Related work
Regression from #6518.
How
readJsonFlagTextpicks each reader with??instead of spreadingpartialIo, so an explicitundefinedkeeps the default. The fix sits in the shared reader, so any other caller that forwards optional readers gets it too.Test plan
parseVariablesArg(undefined, <path>)with no reader reads a real file. On main it fails withcause: "io.readFile is not a function".data-var-text="title", rendered with--variables-file vars.json --strict-variables. 0.8.209 exits 1 with the error above. This branch renders, and the frame shows the title from the file.packages/cli, and thevariables,jsonFlagandmedia-treatmenttests pass (56). In the full CLI suite, the failures on this Mac also fail on main (ffmpeg track decode, whisper/sherpa runtime, Chromium WebGL sweep), apart from two file-watcher timing tests that pass when run alone.check-comment-citationsandcomment-ratchetpass.