serverless-dynamodb-local icon indicating copy to clipboard operation
serverless-dynamodb-local copied to clipboard

Plugin not working after upgrading to SLS v3

Open henhal opened this issue 2 years ago • 2 comments

Actual Behaviour

After updating serverless to v3, I get the following error:

npx sls dynamodb migrate --stage test
Environment: darwin, node 14.18.1, framework 3.7.1 (local), plugin 6.1.5, SDK 4.3.2
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Cannot resolve serverless.yml: Variables resolution errored with:
  - Cannot resolve variable at "provider.environment": Value not found at "file" source

Expected Behaviour

Start dynamodb local as usual

Steps to reproduce it

Install serverless@3 run `sls dynamodb migrate``

LogCat for the issue

Screenshots of the issue

Would you like to work on the issue?

henhal avatar Mar 08 '22 13:03 henhal

Getting a different error with v3 when running: sls dynamodb install TypeError: Cannot convert undefined or null to object

ignas-g avatar Apr 19 '22 19:04 ignas-g

Hello @henhal,

I found a similar issue when running yarn sls dynamodb seed after upgrading to v3. However, if you modify the command to be STAGE={yourStageNameHere} yarn sls dynamodb seed ......., this fixed the issue for me.

Also having provider.stage: ${env:STAGE} set in the serverless.yml will be required.

I hope this helps as I just discovered this now :)

MrNoyce avatar Nov 02 '22 15:11 MrNoyce