Fix: Handle undefined values when resolving Fn::Join in environment variables #1053
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.
Fixes an edge case for #1032 which would cause a crash when environment variables have a value of
undefined
.I can just set the environment variable value and then everything is fine but this error should probably still be fixed because it causes
serverless-offline
to crash where it need not.Good question! Normally you shouldn't, because if you don't need an environment variable set you should probably remove it right?
I was developing locally and I didn't need certain environment variables set for local development with
sls offline
, but I did need them at deploy time. And it was working before I upgradedserverless-offline
to v6.5.0 (for another feature).Example: In my app, I only need the Slack Client ID when I deploy. But I still want to use
sls offline
to test parts of my app locally.SLACK_CLIENT_ID: ${env:SLACK_CLIENT_ID}