Skip to content
New issue

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

fix: [ERR_MISSING_ARGS]: The "message" argument must be specified when using --useChildProcesses #1385

Merged
merged 2 commits into from
Aug 17, 2022

Conversation

khanguyen88
Copy link
Contributor

@khanguyen88 khanguyen88 commented Apr 22, 2022

Description

When a function handler does not return anything in --useChildProcesses, the below error is raised

(node:88622) UnhandledPromiseRejectionWarning: TypeError [ERR_MISSING_ARGS]: The "message" argument must be specified
    at process.target._send (internal/child_process.js:693:13)
    at process.target.send (internal/child_process.js:678:19)
    at process.<anonymous> (/Users/khanguyen/git/atlas-authority/NAFJC/connect/node_modules/serverless-offline/dist/lambda/handler-runner/child-process-runner/childProcessHelper.js:48:11)
(node:88622) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:88622) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

fixes #1473

Motivation and Context

The child process won't be terminated properly and cause memory leak.

How Has This Been Tested?

I don't know if there is any existing unit test for this. I only did testing in my local project where my handler does not return anything, and with this change, the above error disappears.

Screenshots (if appropriate):

@dnalborczyk dnalborczyk changed the title Fix [ERR_MISSING_ARGS]: The "message" argument must be specified when using --useChildProcesses fix: [ERR_MISSING_ARGS]: The "message" argument must be specified when using --useChildProcesses Aug 17, 2022
@dnalborczyk
Copy link
Collaborator

thank you for the PR @khanguyen88

@dnalborczyk dnalborczyk merged commit 91ae1e1 into dherault:master Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UnhandledPromiseRejectionWarning: TypeError [ERR_MISSING_ARGS]
3 participants