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

Fix: Handle undefined values when resolving Fn::Join in environment variables #1053

Closed
wants to merge 1 commit into from

Conversation

connorads
Copy link

@connorads connorads commented Jul 27, 2020

Fixes an edge case for #1032 which would cause a crash when environment variables have a value of undefined.

image

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.

But why would you have undefined environment variable value anyway?

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 upgraded serverless-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}

image

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.

None yet

1 participant