Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serverless framework won't start with dynamodb local

EDIT: As answered below by Carlos, this was a bug with serverless-dynamodb-local version 0.2.23 (version as of this edit is 0.2.35). It has now been resolved and if you are experiencing a similar issue you should update your dependencies.

I had a working dev environment of an AWS Lambda function developed on the Serverless framework, using DynamoDB (plugins: serverless-offline, serverless-dynamodb-local . After deleting node_modules and reinstalling, I have lost the ability to start the development server, which I used to do with serverless offline start

serverless offline works properly, but if I try to run dynamodb locally it throws the following error:

Reference Error ----------------------------------------

  options is not defined

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Stack Trace --------------------------------------------

ReferenceError: options is not defined
    at BbPromise.resolve.then (/Users/pablo/Documents/myProject/node_modules/serverless-dynamodb-local/index.js:164:21)
From previous event:
    at PluginManager.invoke (/Users/pablo/.nvm/versions/node/v6.10.3/lib/node_modules/serverless/lib/classes/PluginManager.js:236:22)
    at PluginManager.run (/Users/pablo/.nvm/versions/node/v6.10.3/lib/node_modules/serverless/lib/classes/PluginManager.js:255:17)
    at variables.populateService.then (/Users/pablo/.nvm/versions/node/v6.10.3/lib/node_modules/serverless/lib/Serverless.js:99:33)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at Serverless.run (/Users/pablo/.nvm/versions/node/v6.10.3/lib/node_modules/serverless/lib/Serverless.js:86:74)
    at serverless.init.then (/Users/pablo/.nvm/versions/node/v6.10.3/lib/node_modules/serverless/bin/serverless:39:50)

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless

  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           6.10.3
     Serverless Version:     1.19.0

Oddly enough, if I go to localhost:8000/shell, the dynamodb shell is running.

has anyone had a similar problem?

like image 354
Pablo Barría Urenda Avatar asked Aug 08 '17 21:08

Pablo Barría Urenda


1 Answers

So it turns it was an issue, registered and solved here: https://github.com/99xt/serverless-dynamodb-local/issues/120

You can download the version 0.2.24 by typing npm i [email protected] --save-dev if you are using it as a development dependency.

like image 132
Carlos Delgado Avatar answered Nov 10 '22 21:11

Carlos Delgado