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
Handle undefined environment variables in resolveJoins #1047
Conversation
Fixes the following exception: ``` Debug: internal, implementation, error TypeError: Cannot read property 'Fn::Join' of undefined at /Users/alexhayton/personal/stablemaster/lambda/node_modules/serverless-offline/dist/utils/resolveJoins.js:17:28 at Array.forEach (<anonymous>) at resolveJoins (/Users/alexhayton/personal/stablemaster/lambda/node_modules/serverless-offline/dist/utils/resolveJoins.js:15:28) at new LambdaFunction (/Users/alexhayton/personal/stablemaster/lambda/node_modules/serverless-offline/dist/lambda/LambdaFunction.js:154:56) at LambdaFunctionPool.get (/Users/alexhayton/personal/stablemaster/lambda/node_modules/serverless-offline/dist/lambda/LambdaFunctionPool.js:93:24) at Lambda.get (/Users/alexhayton/personal/stablemaster/lambda/node_modules/serverless-offline/dist/lambda/Lambda.js:60:88) at hapiHandler (/Users/alexhayton/personal/stablemaster/lambda/node_modules/serverless-offline/dist/events/http/HttpServer.js:511:82) at module.exports.internals.Manager.execute (/Users/alexhayton/personal/stablemaster/lambda/node_modules/@hapi/hapi/lib/toolkit.js:41:33) at Object.internals.handler (/Users/alexhayton/personal/stablemaster/lambda/node_modules/@hapi/hapi/lib/handler.js:46:48) at exports.execute (/Users/alexhayton/personal/stablemaster/lambda/node_modules/@hapi/hapi/lib/handler.js:31:36) at Request._lifecycle (/Users/alexhayton/personal/stablemaster/lambda/node_modules/@hapi/hapi/lib/request.js:312:68) at processTicksAndRejections (internal/process/task_queues.js:97:5) at Request._execute (/Users/alexhayton/personal/stablemaster/lambda/node_modules/@hapi/hapi/lib/request.js:221:9) ```
Can confirm this fixes #1048 for me. Environment |
Is there anything else I need to do for this PR to get accepted? |
I've also added a test suite for this. 🎉 |
I'm guessing that @dherault is away on holiday, like a lot of France in August 🌞🇫🇷 |
If anyone needs a temporary fix you can reference a hotfix package. @connorads/serverless-offline which is v.6.5.0 with added fix from #1053.
|
Thanks @AlexHayton for this amazing fix. |
thank you @dherault ! |
Suggested fix for #1048 - tested locally and it works for me.
I also added a test suite for env var handling
Fixes the following exception:
To reproduce, simply define something in
provider.environment
which isn't set in your local shell: