Giter VIP home page Giter VIP logo

serverless-dynamodb-client's Issues

Not compatible with Node 18 on Lambda due to aws-sdk3

Using this library doesn't seem to play nicely in the Lambda Node 18 runtime.

{ "errorType": "Runtime.ImportModuleError", "errorMessage": "Error: Cannot find module 'aws-sdk'\nRequire stack:\n- /var/task/node_modules/serverless-dynamodb-client/index.js\n- /var/task/handlers/profile.js\n- /var/runtime/index.mjs", "stack": [ "Runtime.ImportModuleError: Error: Cannot find module 'aws-sdk'", "Require stack:", "- /var/task/node_modules/serverless-dynamodb-client/index.js", "- /var/task/handlers/profile.js", "- /var/runtime/index.mjs", " at _loadUserApp (file:///var/runtime/index.mjs:1087:17)", " at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)", " at async start (file:///var/runtime/index.mjs:1282:23)", " at async file:///var/runtime/index.mjs:1288:1" ] }

This may need to be adjusted to import DynamoDB in a way that's compatible with aws-sdk v3
https://github.com/aws/aws-sdk-js-v3

Allow to use custom options

It would be handy to allow using custom options when constructing a DynamoDB object.
For start it would be nice to support defining convertEmptyValues and port in serverless.yml.

TypeError: Plugin is not a constructor

Hey there!

I get a "TypeError: Plugin is not a constructor" when trying to run serverless offline start with serverless-dynamodb-client plugin enabled.

Version I used:

  • serverless v1.32.0
  • node v8.10
  • serverless-offline v3.28.1
  • serverless-dynamodb-local v0.2.35

On top of that I use typescript.

Thanks for the help

process.env.IS_OFFLINE is always undefined

Scenario

Suppose you have configured plugins serverless-dynamodb-local, serverless-offline and serverless-dynamodb-client. Then, you execute commands

$ sls offline & [1]
$ sls invoke local -f function --path input.json [2]

Result

The AWS dynamodb instance will be used, not the local one.

Explanation

The reason is that:

  • command [1] sets environment variable IS_OFFLINE not to the parent shell but to the sls offline process
  • when command [2] is executed, it inherits the environment of the shell, which has no IS_OFFLINE defined. So, when require('serverless-dynamodb-client') is called, isOffline() always returns false.

Workaround

Execute

$ export IS_OFFLINE=true

before command [2]

Feature request: port override

Please allow the port (8000) to be overridden via an environment variable, to make running multiple related services on the same machine easier.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.