Deno

D

Deno

Chat about Deno, a modern runtime for JavaScript and TypeScript.

Join

Setting up Deno 2.0 with Fresh and TypeORM

I am trying to setup my first deno project ever using Fresh and TypeORM. I have setup 2 files A data.ts ```js...

Is there a way to use tsserver instead of deno lsp in VSCode?

Deno LSP lacks features. Is there a way to configure tsserver to work with deno?

Tools to shrink the output of deno compile?

Are there any tools to decrease the filesize of a deno compiled executable? I care primarily about Windows, but am interested in hearing about Linux options, too.

Deno add from different sources (like JSR) doesn't works?

Hi, I'm new with Deno. The problem is: I copy-paste this code deno add jsr:@oak/oak jsr:@tajpouria/cors and deno search it from npm and not jsr, it gives me the error error: npm package '@jsr/oak__oak' does not exist. why?...

deno compile next.js as standalone executable

Hello, Is it possible to compile a next.js project as a standalone executable file using deno's compile command? If so, how could I go about accomplishing this?...

vite + react

I'm following along the deno react tutorial, running deno add jsr:@oak/oak jsr:@tajpouria/cors returns Add jsr:@oak/oak@17.1.0 Add jsr:@tajpouria/cors@1.2.1 error: npm package '@jsr/oak__oak' does not exist....

Deno Vscode type checking randomly gets wrong types for discord.js EmbedBuilder

```ts export class EmbedBuilder extends BuildersEmbed { public constructor(data?: EmbedData | APIEmbed); public override setColor(color: ColorResolvable | null): this; public static from(other: JSONEncodable<APIEmbed> | APIEmbed): EmbedBuilder;...

`deno add` does not support the --cert option and does not use `$DENO_CERT`

I'm on zsh and use a custom registry in my .npmrc, and deno add runs into cert problems. When I add my organizations custom cert file to other deno commands, it works. However, deno add does not have this option, and seems to not use $DENO_CERT. How can I solve this problem? Help is appreciated....

deno and @types/react

In the docs it states that in order to use node packages that don't ship with type but have a @types/... declaration, I have to use the // @deno-types="@types/..." directive. this is fine except when react doesn't ship with types and I have to now include this directive in many many files and it also does not auto complete the import so I manually have to type the import in new files. ...

deno install

How I can set permissions for installed standalone module ? I made my module with 'foobar' name. I made deno.json file with requires info, I run:
deno install
deno install
...

lookupService is not a function

Hello. I was looking to rewrite a small NodeJS app with Deno2 to simplify the setup. It uses the node-opcua npm package. but when I import it, it throws an error. ``` error: Uncaught (in promise) TypeError: dns_1.default.lookupService is not a function at GetAddrInfoReqWrap.callback (file:///home/aw/.cache/deno/npm/registry.npmjs.org/node-opcua-hostname/2.128.0/dist/hostname.js:29:23)...

dependency injection

Using deno and fresh, is there a canonical way to perform dependency injection

Error connecting to https on Windows Server 2012 R2

Error connecting to https on Windows Server 2012 R2 Using both the built-in fetch and npm axios library, I cannot make https calls to my (admittedly old) Windows Server 2012 R2 machine. The code works perfectly under node, but under deno I get an error:...

Deno less verbose in wsl?

I am dev-ing in Vscode with WSL integrated terminal. When I run deno task start the application takes forever to run, the watcher doesn't catch changes, and there are no intermittent or error outputs to the terminal. However when i run deno in the PS terminal it is very responsive, verbose, and the watcher works properly. The wsl version didn't use to be this unresponsive. Does installing the windows (PS) version somehow interfere with the wsl install or is there maybe another issue?...

Errors in boilerplate code?

After running deno run --allow-read --allow-write --allow-env npm:create-vite-extra@latest I see the following errors. (It's important to note that on another computer, there are no errors whatsoever.) Why might I be getting these errors? ...

Performance concerns for docker engine hosting company

Hello! i’m making a hosting company. We have a controller and daemon based infrastructure. Currently the Controller is made with bun and hono and I adore it. It has a phenomenal developer experience compared to golang. Our daemon is made in golang though. We did this as we wanted it to be incredibly fast. My issue with this is that golang has a horrible developer experience compared to typescript for my use case. My only concern before i migrate my codebase to typescript is the performance. This would interact with the docker engine API locally and will have some heavy ram caching running on new gen hardware (7950x, 192gb ram). How many requests can i assume this can safely handle? I want to set a goal at 500 a second, but still want to be able to support higher rates for peak traffic. tldr; i’m making a docker container hosting company. I want to move my daemon (docker engine API and FS wrapper) from golang to typescript. How many req a sec can it safely handle...

Memory leak when conditionally stubbing fetch

I'm having an issue during a test using @std/testing/mock where I want to stub fetch for only a specific URL (an OAuth token exchange endpoint) receiving a mocked response in this case. For all other fetches, I want the fetch to behave normally. Everything seems to be functional however the test is failing due to fetchCancelHandles not being cleared up but I really can't see how this could happen as all requests made have their bodies consumed. I wondered if any smarter people have experienced this before or have any answers as to why this specific behaviour is arising. Error: ```...
No description

Why isn't the API_PORT variable being loaded? Is there something I'm missing?

I'm trying to load an environment variable API_PORT using Deno and the @std/dotenv module, but it’s not being loaded correctly. The variable is undefined when I try to access it with Deno.env.get('API_PORT'). Here’s the code: ``` import { Hono } from '@hono/hono'; import { load } from "@std/dotenv"...

React + Vite (without `node_modules`)

I'm trying to configure a Deno-first React + Vite project without the node_modules dir. I thought this might be doable thanks to the new deno-vite-plugin from the Deno team. Unfortunately I encounter an issue upon running the served/built application (see issue here). Wondering if anyone has ideas on how to resolve this issue? If so, Deno+Vite+React projects will be so much cleaner!