Open alihacks opened 2 months ago
Thanks, you are correct. I will work on updating the documentation. The serverless compose plugin is not compatible with serverless-offline. There's a few options out there to dynamically set them from a stagevar file or .env. But it would require some re-working of the serverless.yml to support it. Alternatively, you can manually drop those variables in there for testing and revert to deploy. I understand it's not ideal. I had to choose between making the deployment easier, or running serverless offline. If you see a way to improve that, please let me know. Happy to make changes.
Allen,
Thanks for your response. I see your point, my recommendation would be to
update the documentation and pass this param at runtime when running
offline such as: serverless offline --httpPort 3015 --stage dev --param="SHARE_ASSISTANTS_ENDPOINT=myval"
By the way - the next issue is this: "The Serverless version (4.3.3) does not satisfy the "frameworkVersion" (3) in serverless.yml" - this is likely because the instructions do not specify a version to install and I happened to get the latest. An easy solution to this is to not recommend installing globally, and running it from the package directory. This ensures control over versioning using package.json - even if it's already globally installed. The version installed in node_modules as a result of npm i
is 3.39. So that command would be:
npx serverless offline --httpPort 3015 --stage dev --param="SHARE_ASSISTANTS_ENDPOINT=myval"
I have tried this on a Windows and a Linux machine, and have gotten the same results. I have followed all the steps in the Readme.md and get the same results.
At steps under "Run Serverless Offline" Trying option 1, in the repo root:
Result is:
However, running
serverless amplify-lamba offline ...
seems to go further, maybe the:
needs to be removed from the instructions?Trying option 2, in the amplify-lambda directory
Result is:
I have no experience using serverless but this may be because this parameter is defined in serverless-compose in the parent directory.