We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
The text was updated successfully, but these errors were encountered:
Work around at the moment is to use a class similar to this:
const HOST = process.env.LOCAL_DDB_HOST || "localhost"; const PORT = process.env.LOCAL_DDB_PORT || 8000; const ENDPOINT = process.env.LOCAL_DDB_ENDPOINT || `http://${HOST}:${PORT}`; const OFFLINE_OPTIONS = { region: "localhost", endpoint: ENDPOINT, accessKeyId: "MOCK_ACCESS_KEY_ID", secretAccessKey: "MOCK_SECRET_ACCESS_KEY", }; const IS_OFFLINE = process.env.IS_OFFLINE || process.env.IS_LOCAL; class OfflineDynamoDB extends DynamoDBClient { constructor(options: DynamoDBClientConfig) { super({ ...options, ...OFFLINE_OPTIONS }); } } export const DynamoDB = IS_OFFLINE ? OfflineDynamoDB : DynamoDBClient;``` This is a breaking change to your code that uses this library though.
Sorry, something went wrong.
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: