Deno Deploy failed:Uncaught Exception /Permission Denied : Deno.exit() is not allowed
I have a college assignments that needs to be deployed using deno deploy but i get this message when i try to deploy it, my code works fine locally.
![No description](https://cdn.answeroverflow.com/1172263235672608858/deno_error.jpg)
5 Replies
The
Deno.exit()
function is not available on Deno Deploy. It doesn't really make sense in a serverless platform where you spin a function up and it terminates when it is done
The function/process will automatically exit once all work is completed.this the bit of code where i use deno.exit, if i remove it MONGO_URL will give an error
![No description](https://cdn.answeroverflow.com/1172265903249960970/image.png)
yesterday late in the night i was going insane trying to make the deploy and tried it today too but cant get it to work
Yeah looking at the code it looks like you want to abort execution when
MONGO_URL
is not set. So if we cannot use Deno.exit()
we need to use something else to abort execution there. If we just remove it, then it would continue to run.
What you normally do is wrap this part in an if-else
statement or even a function.
The same written as a function:
yeah i tried to wrap it in a if-else statement and now im getting the following error : ISOLATE_INTERNAL_FAILURE