cvs0
cvs013mo ago

Cannot use deno prompt when in windows CMD

It only works in the VSCode integrated terminal? I have added some output around the run command, but when i do run <filename>.cvs it doesnt even reach any of the outputs.
51 Replies
cvs0
cvs0OP13mo ago
cvs0
cvs0OP13mo ago
heres the code. Just as a note it works perfectly fine inside the VSCode powershell integrated terminal.
PastelStoic
PastelStoic13mo ago
exactly what command are you giving it?
cvs0
cvs0OP13mo ago
To run it im using deno run -A main.ts --developer --developer being my custom arguement. it still doesnt work without my custom arguement.
PastelStoic
PastelStoic13mo ago
and what is the error message?
cvs0
cvs0OP13mo ago
I said earlier, there is none. Nothing happens. Oh sorry, i did not say that earlier lol can anyone help??
PastelStoic
PastelStoic13mo ago
cd up one level and see what happens same error?
cvs0
cvs0OP13mo ago
Sorry, what do you mean? like cd up to a different dir and run the script from there?
PastelStoic
PastelStoic13mo ago
run the same command, I mean if there's no console output at all, we need to start narrowing things down is it an issue with the script and powershell in combination, or just with powershell overall? a restart may also serve you well - windows can be troublesome about these things
cvs0
cvs0OP13mo ago
I have had this issue for a month or two. even powershell doesnt work. The only thing that works is the VSCode integrated powershell terminal.
PastelStoic
PastelStoic13mo ago
I mean not this scrpt just run "deno" in powershell no args can you enter the REPL?
cvs0
cvs0OP13mo ago
No description
cvs0
cvs0OP13mo ago
yep
PastelStoic
PastelStoic13mo ago
alright, wonderful and attempting to run the command from the wrong directory gives a "file not found" error, yes?
cvs0
cvs0OP13mo ago
No description
cvs0
cvs0OP13mo ago
yep was this what you meant?
PastelStoic
PastelStoic13mo ago
running the command without -A does nothing as well? running a different file within the same directory? a different file in a different directory?
cvs0
cvs0OP13mo ago
Oh im sorry lol didnt know what you meant like a totally different script?
PastelStoic
PastelStoic13mo ago
yes the goal is to see if this particular script is the problem
cvs0
cvs0OP13mo ago
Alright. let me make another script.
PastelStoic
PastelStoic13mo ago
a basic hello world will do
cvs0
cvs0OP13mo ago
Alrighty
cvs0
cvs0OP13mo ago
No description
cvs0
cvs0OP13mo ago
yeah its good.
PastelStoic
PastelStoic13mo ago
alright so we've narrowed down the issue to this script
cvs0
cvs0OP13mo ago
I have narrowed it down abit more. It never even makes it to reading the file. If i run it without permissions, here is the output in vscode:
cvs0
cvs0OP13mo ago
No description
PastelStoic
PastelStoic13mo ago
perhaps one of the imports is creating a silent crash
cvs0
cvs0OP13mo ago
In the cmd it just hangs.
cvs0
cvs0OP13mo ago
No description
cvs0
cvs0OP13mo ago
sticks like this forever
PastelStoic
PastelStoic13mo ago
now this is a bit silly but when it hangs what happens if you hit a key I've had an issue with .NET apps where the console hangs until it detects keyboard input even when there's no readline
cvs0
cvs0OP13mo ago
Hey, thanks for that. Found this:
cvs0
cvs0OP13mo ago
No description
cvs0
cvs0OP13mo ago
it hangs. then i type another key and press enter then it works.
PastelStoic
PastelStoic13mo ago
ah, so the same problem
cvs0
cvs0OP13mo ago
Weird how this is a cmd specific issue.
PastelStoic
PastelStoic13mo ago
I can only assume it's a powershell bug that microsoft never fixed so the vscode people did it themselves since i've now seen it happen across two unrelated languages
cvs0
cvs0OP13mo ago
Oh really? Yeah not powershell specific.
cvs0
cvs0OP13mo ago
No description
cvs0
cvs0OP13mo ago
happens over two seperate environments
PastelStoic
PastelStoic13mo ago
windowsa command prompt is just an old version of powershell really wouldn't be surprised if bugs persisted
cvs0
cvs0OP13mo ago
Could it be an issue in my code?
PastelStoic
PastelStoic13mo ago
more like I think there's something in async stuff that windows just has trouble with sometimes
cvs0
cvs0OP13mo ago
Ohhh, that makes sense.
PastelStoic
PastelStoic13mo ago
there's a reason nobody deploys actual production on windows machines
cvs0
cvs0OP13mo ago
Yeah lol Is there anything i could do to fix this in my code? or do i just gotta live with this
PastelStoic
PastelStoic13mo ago
you could always strip everything except the imports, run it, then add back in one thing at a time until you find what breaks it
cvs0
cvs0OP13mo ago
Doesnt seem to be an async issue either.
marvinh.
marvinh.13mo ago
@cvs0 we've just published Deno 1.39.0 and I think https://github.com/denoland/deno/pull/18453 is a fix for that. Can you try updating and see if it resolves the issue?
cvs0
cvs0OP13mo ago
Hey thanks!