DenoDDeno
Powered by
jeff.hykinJ
Denoβ€’4y agoβ€’
7 replies
jeff.hykin

Deno.run Strange Issue

I use
Deno.run
Deno.run
+ stdout/signals/etc a lot, but this behavior is beyond my current debugging abilities

I have a command
nix eval ...
nix eval ...
which works fine in a python subshell, and on the commandline. However, Deno.run with piped stdout makes it hang indefinitely. To be explicit, in this block:
process.status().then(callback).catch(callback)
process.status().then(callback).catch(callback)
the callback doesn't run until a
.kill()
.kill()
is used (SIGHUP/SIGINT/SIGKILL). Tested on Deno 1.29.4 and Deno 1.22.0 for good measure.

What is even more strange is trying to bypass the problem with hackery also fails.
All of these round-about execution methods (translated to Deno.run) also hang indefinitely:

-
bash -c '[command]'
bash -c '[command]'

-
bash ./file_with_command.sh
bash ./file_with_command.sh

-
bash -i ./file_with_command.sh
bash -i ./file_with_command.sh


In particular the
bash -i
bash -i
method not only hangs, but also exclusively makes it so that ctrl+C, ctrl+D, and even ctrl+Z are ignored; I have to kill the deno process from another termial.

Env:
bash -c env
bash -c env
prints out the EXACT same env vars for Deno/Python/CLI
Cwd: deno/python/cli all have the same working directory
Interactivity: running it with
deno repl
deno repl
has been the same as
deno run
deno run

Piping:
Manually closing the stdout pipe doesn't work/help.
Removing
stdout: 'piped'
stdout: 'piped'
, makes command not-hang (but defeats the point).
Adding
stderr: 'piped'
stderr: 'piped'
still causes a hang.

I don't even know what else could be possibly causing a difference (Deno & Python code attached as comments)
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

`deno run` ignores @deno-types?
DarveshDDarvesh / help
3y ago
Deno build/run
Deno AI HelperDDeno AI Helper / help
3y ago
deno run --watch
lioLlio / help
4y ago