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

UnhandledPromiseRejectionWarning: Error: Must run at most one command #784

Closed
daniel-sudz opened this issue Feb 10, 2021 · 1 comment
Closed

Comments

@daniel-sudz
Copy link

daniel-sudz commented Feb 10, 2021

I'm getting this warning occasionally and I'm unable to reproduce it consistently. Sometimes the error throws with the same build command while sometimes it does not. The build seems to always work however without a problem.

(node:93570) UnhandledPromiseRejectionWarning: Error: Must run at most one command
    at Object.writeToStdin (/[Redacted]/node_modules/esbuild/lib/main.js:1422:15)
    at sendResponse (/[Redacted]/node_modules/esbuild/lib/main.js:563:14)
    at /[Redacted]/node_modules/esbuild/lib/main.js:617:7
    at Generator.next (<anonymous>)
    at /[Redacted]/node_modules/esbuild/lib/main.js:27:61
    at new Promise (<anonymous>)
    at __async (/[Redacted]/node_modules/esbuild/lib/main.js:9:10)
    at handleRequest (/[Redacted]/node_modules/esbuild/lib/main.js:565:40)
    at handleIncomingPacket (/[Redacted]/node_modules/esbuild/lib/main.js:632:7)
    at readFromStdout (/[Redacted]/node_modules/esbuild/lib/main.js:517:7)

This is the build command that I'm using:

const build = (inputPath: string, outputName: string) => {
  esbuild.buildSync({
    entryPoints: [path.resolve("../../", inputPath)],
    bundle: true,
    target: "esnext",
    platform: "node",
    outfile: `./bundles/${outputName}`,
    external: ["protobufjs"], 
  });
};

The buildSync commands runs several times within a for loop.

@evanw
Copy link
Owner

evanw commented Feb 10, 2021

Thanks for the report. I suspect this is a regression that I introduced in version 0.8.39 when I fixed #643. The child process now periodically pings the host process and will exit if the ping doesn't go through to avoid becoming a dangling child process. I think the response from the ping is being incorrectly counted as a second command.

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 a pull request may close this issue.

2 participants