question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

not working with lambda function

See original GitHub issue

Hello i am trying to use node-formidable with aws serverless lambda function but it is giving me ERROR -

req.on is not a function

MY CODE IS ;

var formidable = require("formidable");
  const util = require("util");
export async function upload(event, context, callback) {
 context.callbackWaitsForEmptyEventLoop = false;
  var form = new formidable.IncomingForm();
 form.parse(event, function(err, fields, files) {
    let response = util.inspect({ fields: fields, files: files });
    console.log(response);
  });

cc @felixge

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
muttonicommented, Jul 6, 2018

Maybe I can help clarify: Lambda/Azure functions receive the raw JSON response without any lifecycle hooks. So in case of multipart/form data the JSON is there ready to parse (with boundaries and/or raw file contents which are usually not base64encoded if multipart but they usually are if it’s a file upload). Does this help?

5reactions
manishjha1991commented, Jun 27, 2018

I am using AWS Serverless and event is just like req in express framework .

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I troubleshoot Lambda function failures? - AWS
To troubleshoot Lambda function failures, first determine what's causing the error by using one or more of the AWS services and features ...
Read more >
python - Lambda function not working properly - Stack Overflow
The problem with the above approach is that lambda s were created to be nameless. Using a lambda when you ... Just stick...
Read more >
My Lambda function is not getting invoked all of a sudden.
My Lambda function is not getting invoked all of a sudden. · First make sure that the IAM Role attached to your Lambda...
Read more >
Lambda Troubleshooting - A Cloud Guru
Run one test and check the CloudWatch logs to see which Lambda functions did and did not run. Is something missing, is there...
Read more >
Troubleshoot enabling serverless monitoring of AWS Lambda
Solution · Has the Lambda function appeared in the UI before? If so, what is the name of the function? · If some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found