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

execaSync() does not work but await execa() does #20782

Closed
felipecrs opened this issue Oct 4, 2023 · 2 comments · Fixed by #21103
Closed

execaSync() does not work but await execa() does #20782

felipecrs opened this issue Oct 4, 2023 · 2 comments · Fixed by #21103
Labels
bug Something isn't working correctly node compat

Comments

@felipecrs
Copy link

https://github.com/sindresorhus/execa is a great tool that simplifies command executions in Node. I'm trying to convert my applications to use Deno and I stumbled upon this issue.

// test.ts

import {execaSync, execa} from 'npm:execa@8.0.1';

let result = await execa('echo', ['unicorns async']);
console.log(result.stdout);

result = execaSync('echo', ['unicorns sync']);
console.log(result.stdout);
deno run -A test.ts
unicorns async
error: Uncaught (in promise) Error: Command failed: echo unicorns sync
    at makeError (file:///home/felipecrs/.cache/deno/npm/registry.npmjs.org/execa/8.0.1/lib/error.js:60:11)
    at execaSync (file:///home/felipecrs/.cache/deno/npm/registry.npmjs.org/execa/8.0.1/index.js:201:17)
    at file:///tmp/tmp.Qq2z9kWPKd/test.ts:6:10
    at Object.runMicrotasks (ext:core/01_core.js:848:30)
    at processTicksAndRejections (ext:deno_node/_next_tick.ts:53:10)
    at runNextTicks (ext:deno_node/_next_tick.ts:71:3)
    at eventLoopTick (ext:core/01_core.js:189:21)
@littledivy littledivy added bug Something isn't working correctly node compat labels Oct 4, 2023
@felipecrs
Copy link
Author

Just to update: the same problem still happens as of deno 1.38.0.

@bartlomieju
Copy link
Member

This should be fixed in Deno v1.38.1 later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants