Deno

D

Deno

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

Join

Running multiple Deno versions at the same time

Is it safe to run multiple Deno versions on the same machine at the same time or is there a risk of some sort of conflict due to dependency caching, shared directories and friends?

How to detect if executing on main thread vs worker

```ts function main() { // create worker from this same file const worker = new Worker(import.meta.resolve("./mod.ts"), { name: "hello-worker",...

await promise does not yield control

https://github.com/denoland/deno/issues/24360 Is this a bug or not? If so, is it a bug of Deno? of V8? of JS?...

HTTPS imports in browser breaking stuff.

I'm trying to build this tiny React app (just a foundation for the bigger project) and the bundle builds with esbuild, however I'm getting the errors from the screenshot. Here's the link to the repo: https://github.com/angeldollface/shonk.ts...
No description

Jsr, esm, x and external ref

Hi, I want to migrate most of my import to jsr to simplify code. I use Hono and 3rd party middleware on Deno. I import them with esm / deno.land ...

command.spawn() stdin and stdout

I am not sure if I am handling the writeable stream and readable stream correctly. I assigned getWrite and getReader to writer and reader in my class. I am slightly confused on what ready, releaseLock is as it's not well documented (from what sourced I can find) ```ts...

How to define local import maps?

I got these things in the tests above: ```ts import { assertAlmostEquals, assertEquals } from "@std/assert"; import { Vector2 } from "../src/math/mod.ts"; import { QUARTER_PI } from "../src/utils/math.util.ts";...

Way too iterate over Deno.serve connections?

Hi, as a lot of the old http api's are now deprecated, I would like to know if there is a nice way to achieve the following: Create a Deno.serve instance, iterate over each request, my goal is to put this in an async generator that yields upgraded websockets. This is doable with the Deno.listen api, but now that the Deno.serveHttp is deprecated, I'm not sure how to proceed....

Trouble getting lcl.host to work with Fresh

I am trying to implement the https://lcl.host from https://anchor.dev into my fresh project, as I am implementing Stripe and some payment options needs to run in https. Having some trouble getting the code setup correctly. They offer three installation option. 1. Node - 2.Vite and 3. Nextjs

Problem with www.

I currently have the domain https://ricardorobles.es correctly with my Deno Deploy project. I have tried adding a CNAME...
No description

Change default route in Fresh

Is there a way to make Fresh redirect to another url such as https://mysite.com/home instead of https://mysite.com/?

thread 'tokio-runtime-worker' has overflowed its stack

I have a complex CLI application to generate PDF's with pdfkit and a few extra libraries. After the latest Deno update
deno --version deno 1.44.4 (release, aarch64-apple-darwin)...

Plain javascript in .js files in vscode

How can I have DOM suggestions in .js files, while having Deno suggestions in .ts files?

BadCertificate error using deno 1.25.4

Hello, I am facing an error in my deno + node js app. I cannot figure out how why it is happening. The error is too vague for me. I'm simply trying to install the dependencies. My environment (using Ubuntu 22.04.4 LTS): kkaravaev@kkaravaev1:~$ node -v v16.20.2...

'React' refers to a UMD global, but the current file is a module.

I am using Deno with the GitHub Actions, and my linting is getting passed but I don't know what is happening when Deno trying to run tests I am getting an error ```tsx Check file:///home/runner/work/react-todo/react-todo/tests/page.test.tsx error: TS2686 [ERROR]: 'React' refers to a UMD global, but the current file is a module. Consider adding an import instead....
No description

Can I transpile TypeScript Code to JavaScript Code with Deno like Bun

Hey I have 10/15 typescript files. SO can i transpile it into javascript code?

Passing props to component from layout

I'm trying to pass some client side data from layout to route component, how do I pass this in? I tried props on <Component> but that was giving me errors

Parsing Typescript with deno_core and deno_ast fails on type annotations

Hey all, i'm trying to embed deno into my app so that users can write config file in typescript. I got inspired by the "Roll your own JavaScript runtime" blog series, but they seem to be a bit outdated... The examples in the deno_core repo are not perfect either. I'm trying to write the following code:...

intercept an op rust-side and call the original fn

Hi, i'm using deno_core and some exts embedded in a desktop application, and am trying to replace an existing op with my own version in which i do some additional checks before calling to the original op's function. i can replace the op using Extension::middleware_fn, but i can't see a way to access the original op's function. the simplest way i can think to do this would be to modify the op2 macro to expose the raw function. am i missing something simpler? for context, i want to modify op_ws_create from deno_websocket to do a (potentially asynchronous) permission check, and add some default headers. i don't want to do it javascript-side because i worry that would be exploitable, but maybe it can be done safely (my js knowledge is far below my rust knowledge). i can't use the built-in WebSocketPermissions trait as it is a synchronous function (i guess i could modify it to be async instead)....