Render Deno support?

Hi,

I have a service made with deno and it seems that I cannot startup service after deployment as deno is not supported → bash: deno: command not found. Is there anything to do ?

-Jouni

Hi there,

Thanks for reaching out.

Deno is not currently one of the languages or tools provided on our Native Environments.

However, you should be able to install it as part of the Build Command, maybe something like:

  1. Set a DENO_INSTALL environment to /opt/render/project/.deno

  2. Include the Deno install script in your Build Command: curl -fsSL https://deno.land/x/install/install.sh | sh && any_other_commands_you_need

  3. Update your Start Command to update the PATH with the Deno install: export PATH="$DENO_INSTALL/bin:$PATH" && your_start_command

Hope that helps

Alan

Hi,

Unfortunately, I wasn’t able to succeed. Build was ok, but deployment failed. Tried to follow your guidance and had few variations :), but seems that wasn’t competent enough. Thanks from your help anyway.

-Jouni

I tried the code I shared before I shared it, and it worked fine (admittedly, I’m not a Deno expert, and was just running some “Hello World” code).

If you want us to take a look at your service in particular, please feel free to open a ticket from the “Contact Support” link in the dashboard.

Alan

Thanks Alan, need to try again and will take your offer from the support, if and when needing it.

What I understood I was required to do was that I needed to add DENO INSTALL as a key with /opt/render/project/.deno value to the envirionment variables section. Then I set curl -fsSL https://deno.land/x/install/install.sh to be a build command and
finally I added export PATH=“$DENO_INSTALL/bin:$PATH” && deno run --allow-all app.js in the start command.

You likely already see what I’m doing wrong so pls :slight_smile:

-Jouni

Help ticket raised.

Still tried a bit, Deno was installed successfully to /opt/render/motoserv/.deno/bin/deno, but launching it doesn’t seem to work. Some logging below:

Dec 23 09:19:41 AM Manually add the directory to your $HOME/.bashrc (or similar)
Dec 23 09:19:41 AM export DENO_INSTALL=“/opt/render/motoserv/.deno”
Dec 23 09:19:41 AM export PATH=“$DENO_INSTALL/bin:$PATH”
Dec 23 09:19:41 AM Run ‘/opt/render/motoserv/.deno/bin/deno --help’ to get started
Dec 23 09:19:41 AM
Dec 23 09:19:41 AM Stuck? Join our Discord Deno
Dec 23 09:19:41 AM ==> Generating container image from build. This may take a few minutes…
Dec 23 09:20:24 AM ==> Uploading build…
Dec 23 09:20:37 AM ==> Build uploaded in 12s
Dec 23 09:20:37 AM ==> Build successful :tada:
Dec 23 09:20:37 AM ==> Deploying…
Dec 23 09:20:51 AM ==> Starting service with ‘/opt/render/motoserv/.deno/bin/deno run --allow-all app.js’
Dec 23 09:20:51 AM bash: /opt/render/motoserv/.deno/bin/deno: No such file or directory

You’ve changed the paths from my example. Only files under /opt/render/project will be saved as part of the image used when booting the instance.

My simplified working example:

  • Env Var: DENO_INSTALL set to /opt/render/project/.deno
  • Build Command: curl -fsSL https://deno.land/install.sh | sh
  • Start Command: export PATH="$DENO_INSTALL/bin:$PATH" && deno --version

This results in:

...
Dec 23 08:53:04 AM  ==> Running build command 'curl -fsSL https://deno.land/install.sh | sh'...
Dec 23 08:53:05 AM  #=#=#                                                                         
##O#- #                                                                       

                                                                           0.1%
################################################                          67.1%
######################################################################## 100.0%
Dec 23 08:53:05 AM  Archive:  /opt/render/project/.deno/bin/deno.zip
Dec 23 08:53:06 AM    inflating: /opt/render/project/.deno/bin/deno
Dec 23 08:53:06 AM  Deno was installed successfully to /opt/render/project/.deno/bin/deno
Dec 23 08:53:06 AM  Manually add the directory to your $HOME/.bashrc (or similar)
Dec 23 08:53:06 AM    export DENO_INSTALL="/opt/render/project/.deno"
Dec 23 08:53:06 AM    export PATH="$DENO_INSTALL/bin:$PATH"
Dec 23 08:53:06 AM  Run '/opt/render/project/.deno/bin/deno --help' to get started
Dec 23 08:53:06 AM  
Dec 23 08:53:06 AM  Stuck? Join our Discord https://discord.gg/deno
Dec 23 08:53:20 AM  ==> Uploading build...
Dec 23 08:53:24 AM  ==> Build uploaded in 2s
Dec 23 08:53:24 AM  ==> Build successful 🎉
Dec 23 08:53:24 AM  ==> Deploying...
Dec 23 08:54:04 AM  ==> Detected Node version 16.19.0
Dec 23 08:54:04 AM  ==> Starting service with 'export PATH="$DENO_INSTALL/bin:$PATH" && deno --version'
Dec 23 08:54:04 AM  deno 1.29.1 (release, x86_64-unknown-linux-gnu)
Dec 23 08:54:04 AM  v8 10.9.194.5
Dec 23 08:54:04 AM  typescript 4.9.4
...

While this example doesn’t succeed to a full deploy (as the start command is just outputting the Deno version), the deno command is working and outputting as expected.

Alan

Thank you, got it finally working.

Best Regards, Jouni

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.