cvs0
cvs06mo 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
cvs06mo ago
cvs0
cvs06mo ago
heres the code. Just as a note it works perfectly fine inside the VSCode powershell integrated terminal.
PastelStoic
PastelStoic6mo ago
exactly what command are you giving it?
cvs0
cvs06mo 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
PastelStoic6mo ago
and what is the error message?
cvs0
cvs06mo ago
I said earlier, there is none. Nothing happens. Oh sorry, i did not say that earlier lol can anyone help??
PastelStoic
PastelStoic6mo ago
cd up one level and see what happens same error?
cvs0
cvs06mo ago
Sorry, what do you mean? like cd up to a different dir and run the script from there?
PastelStoic
PastelStoic6mo 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
cvs06mo 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
PastelStoic6mo ago
I mean not this scrpt just run "deno" in powershell no args can you enter the REPL?
cvs0
cvs06mo ago
No description
cvs0
cvs06mo ago
yep
PastelStoic
PastelStoic6mo ago
alright, wonderful and attempting to run the command from the wrong directory gives a "file not found" error, yes?
cvs0
cvs06mo ago
No description
cvs0
cvs06mo ago
yep was this what you meant?
PastelStoic
PastelStoic6mo 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
cvs06mo ago
Oh im sorry lol didnt know what you meant like a totally different script?
PastelStoic
PastelStoic6mo ago
yes the goal is to see if this particular script is the problem
cvs0
cvs06mo ago
Alright. let me make another script.
PastelStoic
PastelStoic6mo ago
a basic hello world will do
cvs0
cvs06mo ago
Alrighty
cvs0
cvs06mo ago
No description
cvs0
cvs06mo ago
yeah its good.
PastelStoic
PastelStoic6mo ago
alright so we've narrowed down the issue to this script
cvs0
cvs06mo 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
cvs06mo ago
No description
PastelStoic
PastelStoic6mo ago
perhaps one of the imports is creating a silent crash
cvs0
cvs06mo ago
In the cmd it just hangs.
cvs0
cvs06mo ago
No description
cvs0
cvs06mo ago
sticks like this forever
PastelStoic
PastelStoic6mo 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
cvs06mo ago
Hey, thanks for that. Found this:
cvs0
cvs06mo ago
No description
cvs0
cvs06mo ago
it hangs. then i type another key and press enter then it works.
PastelStoic
PastelStoic6mo ago
ah, so the same problem
cvs0
cvs06mo ago
Weird how this is a cmd specific issue.
PastelStoic
PastelStoic6mo 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
cvs06mo ago
Oh really? Yeah not powershell specific.
cvs0
cvs06mo ago
No description
cvs0
cvs06mo ago
happens over two seperate environments
PastelStoic
PastelStoic6mo ago
windowsa command prompt is just an old version of powershell really wouldn't be surprised if bugs persisted
cvs0
cvs06mo ago
Could it be an issue in my code?
PastelStoic
PastelStoic6mo ago
more like I think there's something in async stuff that windows just has trouble with sometimes
cvs0
cvs06mo ago
Ohhh, that makes sense.
PastelStoic
PastelStoic6mo ago
there's a reason nobody deploys actual production on windows machines
cvs0
cvs06mo ago
Yeah lol Is there anything i could do to fix this in my code? or do i just gotta live with this
PastelStoic
PastelStoic6mo 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
cvs06mo ago
Doesnt seem to be an async issue either.
marvinh.
marvinh.6mo 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
cvs06mo ago
Hey thanks!