Wednesday 25 March 2020

[Noob Here]Trying to use nanoid on AWS Lambda, some help?

Hey guys!I'm trying to use nanoid in aws lambda without success, because it warns that the variable is not a function:const nanoid = require('nanoid'); const AWS = require("aws-sdk") exports.handler = async (event) => { var i = 10; while (i--) { console.log(nanoid()); } }; the error:Response: { "errorType": "TypeError", "errorMessage": "nanoid is not a function", "trace": [ "TypeError: nanoid is not a function", " at Runtime.exports.handler (/var/task/index.js:7:21)", " at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)" ] } and what im follow:https://www.npmjs.com/package/nanoid

Submitted March 25, 2020 at 06:03PM by LuizThiago

No comments:

Post a Comment