Repository navigation
fix: fail !env substitution when the named variable is missing (fixes #63) - #67
Merged
Merged
Conversation
LucDeCaf
previously approved these changes
Sep 17, 2026
LucDeCaf
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the contribution! Tested this on my side and it looks good, just a few small observations.
Also, don't forget to sign the CLA. :)
Contributor
Author
|
Signed the CLA. I also reworded the |
LucDeCaf
approved these changes
Oct 26, 2026
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.
Summary
!envalready recorded a parse error that named a missing variable, butparseYamlFileignoreddoc.errorsand returned the variable name as the value.validate/deploythen treateduri: PS_DATABASE_URIas a connection string, and Cloud reportedPSYNC_S1109(protocol must be postgresql, got undefined). Parse now fails with that existing message so the missing variable is named, and--validate-only=connectionsno longer swallows the failure.The reporter reproduced the Cloud protocol error on #63. Docs and README only describe process environment variables, not
.envfiles.Decision
!envparse error (name the missing variable). Do not auto-load.env/.env.local..envthen.env.localfrom the working directory (without overriding exported variables).ensureServiceTypeMatchesonly reads_type, so it usesparseYamlDocumentPreserveTagsand does not require template!envplaceholders to be set (same idea as the docker plugin when merging snippets).Testing
parseYamlFilethrows namingPS_DATABASE_URIwhen unset, and still substitutes when set.powersync validate --validate-only=connectionsfails with that name and does not calltestConnection.powersync link self-hostedstill works whenservice.yamlhas unresolved!envURIs.Closes #63