D
Deno

help

Deno Deploy failed:Uncaught Exception /Permission Denied : Deno.exit() is not allowed

JJMvelasco11/9/2023
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
Mmarvinh.11/9/2023
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.
JJMvelasco11/9/2023
this the bit of code where i use deno.exit, if i remove it MONGO_URL will give an error
No description
JJMvelasco11/9/2023
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
Mmarvinh.11/9/2023
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.
if (!MONGO_URL) {
console.log("No mongo url found")
} else {
await mongoose.connect(MONGO_URL);
// ...etc
}
// END OF FILE
if (!MONGO_URL) {
console.log("No mongo url found")
} else {
await mongoose.connect(MONGO_URL);
// ...etc
}
// END OF FILE
The same written as a function:
async function bootServer() {
if (!MONGO_URL) {
console.log("No mongo url found")
return
}
await mongoose.connect(MONGO_URL);
// ...etc
}

await bootServer();
// END OF FILE
async function bootServer() {
if (!MONGO_URL) {
console.log("No mongo url found")
return
}
await mongoose.connect(MONGO_URL);
// ...etc
}

await bootServer();
// END OF FILE
JJMvelasco11/9/2023
yeah i tried to wrap it in a if-else statement and now im getting the following error : ISOLATE_INTERNAL_FAILURE

Looking for more? Join the community!

Recommended Posts
Connect to a WebSocket through a HTTP(S)/SOCKS5 proxyTitle - I am trying to connect to a `wss://` websocket through a proxy of choice at runtime. Is therExternal package code throws error: window is undefinedHello, I have imported an npm package to my project. And in this package's code, there is a conditiError with importsI have this fancy peace of code that import a bunch of files from a directory: ```ts const utils = Deno.env via fileHow can I use set env from a file and get them via deno.env.get() function as i want to push my codeRunning LLaMA on DenoHello! I use Deno to run my apps on the edge, what Deno solution or other provider would be ideal Occasional very slow isolate start timesI have a Vue.js app (using Vite) project with a few edge functions running on Deno Deploy. What I'mChanging terminal zoom in windows?Is it possible to change the terminal zoom using deno? Also, this is about windows terminal, not conWhimsical error shows up when I run a fileI'm trying to make a discord bot with Deno and d.js but for some reasons I get this error ```tex errI cannot able to install itwhen i run ```sh irm https://deno.land/install.ps1 | iex ``` i got this error messageDeno lint custom rulesHey is there currently a way to create custom rules for Deno lint? And if so how can I specify a cususing OpenAI npm in Deno deploy playground:i don't know how to return the resualt , now this just return [object Object] i don't how to use asFrontend & Backend in one Deno Deploy projectI have a Nuxt 3 frontend and an Oak backend. Is it technically possible to deploy both in one deno dIs there a split_to_array function like join_to_stringI need to split a string with some delimiter `=[, ` and ask my self if there is something in deno whHow to set proxy to overall all requests coming from application?In Node JS, we can `import https` and set `https.proxy = "proxyDetails` However, I couldn't find a w