Deno

D

Deno

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

Join

Sequential queue processing with Deno KV listenQueue?

I'm working on an API endpoint that needs to process lots of calls every second. I want to make this call asynchronous so that the API returns fast and I can offload the data to be processed in the background, so I thought of using Deno.kv queues(https://docs.deno.com/deploy/kv/manual/queue_overview/). The only issue is that there is a lot of async code inside the processing jobs, and when I queue up a lot of them they seem to overlap in processing, which causes issues when accessing shared resources(db connections specifically). Is there a way to make kv.listenQueue process each entry in sequence? This is effectively my queue code: ```ts const kv = await Deno.openKv(); ...

Error when deploy on AWS Lightsail: "exec /tini: exec format error"

Following the official tutorial to deploy on AWS Lightsail. I have the same files (main.ts, Dockerfile, docker-compose.yml), and it works in local. I pushed to Docker Hub then pulled, it works as well. However, when deploy it to Lightsail, it failed with error: exec /tini: exec format error ...
No description

How to specify/identify TypeScript version?

We are migrating our codebase to TypeScript 5.6, and we would like Deno to respect that version in fmt, lint and VS Code LSP. Is the TypeScript version in Deno configurable?...
No description

Cant configure Tailwind with DaisyUI using Deno inside of Docker | Error: Cannot find module daisyui

I'm literally pulling my hair right now because i can't figure out why is it not working in my case. I got tailwind to work but i can't figure out why the DaisyUI can't be found. Im using docker for local development and here is my config related to deno. deno.json...

New to Deno, why are namespaces discouraged?

I can't find much information about this online. I'm getting this lint warning when using namespaces, but they've worked no problem when I was using plain TypeScript with Node. I'd like to be able to default import one namespace and tab-complete the functions I need. I'm using the Deno extension in VSCode....
No description

Is there an existing deno in-memory file system library similar to memfs for node?

Apologies if this is the wrong place for “does x exist” questions. Happy to move it to a more appropriate channel if needed. I came across this discussion from 2019 - https://github.com/denoland/deno/issues/1836 - and I’m wondering if anyone has implemented such a library? Update: just wanted to add that I haven’t actually tried using memfs in Deno. I just assumed it wouldn’t work....

@std:testing/mock assertSpyCall - checking args for a partially matching object.

In Jest, you can do partial object matching - like this: ```expect(obj).toEqual( expect.objectContaining({ id: '111' })...

Understanding deno test Behavior with Interdependent Modules

I'm seeking clarification on how Deno's test runner (deno test) manages interdependent modules. Consider the following module dependencies: Module A depends on Module B Module B depends on Module C If I execute deno test for Module A, will the test runner automatically execute the test cases for Modules B and C, given their dependency chain?...

Concurrent fetch timing

Hey all :playful_deno: I'm trying to find a way of accurately timing a few fetch calls that are triggered concurrently. I tried something basic, but each new request will have an increased time, probably due to the internal fetch pool having some delay to send new requests: ```...

Beginner question about Deno on the web

Hi, I've been looking into Deno recently and I love everything I'm reading so far but something I'm confused about is: what does it actually mean to use Deno for a website frontend? Isn't Deno a runtime? What can it do on the browser? I tried experimenting with SvelteKit and Deno by doing deno run -A npm:sv create, deno install, deno task dev, but as I expected, all I'm still writing is normal browser code. Where does Deno come in? Keep in mind that I'm not super well versed in a lot of web technologies so this might just be a misunderstanding on my part....

Referencing environment variables from .env in deno compile or deno task commands

Is this possible? I can reference predefined env variables like PATH fine, but any env variables that are defined in .env seems out of reach by the Deno CLI.

Deno VSCode extension issues with tsconfig.json

Hi everyone! I was following Deno's nextjs Dinasour example, and I noticed that If I enable the Deno extension I get the issues shown on the image. Anyone knows how to stop this from happening? I don't have any other related TS extensions enabled.
No description

Cannot make Koffi (npm) work with its module after compile

Hello, I wanted to try reading dll with Koffi but when it's compiled, it doesn't work because it need to access its module. I tried to include them with --include like the Koffi's documentation said https://koffi.dev/packaging but I didn't manage to make it work. I don't know if the issues is from Koffi, Deno or me being a completely idiot... You can easily test it with this code ```ts...

Access project dependency through Deno API

Maybe I am solving the wrong problem here, but I want to copy a deno dependency into my esbuild bundle so that it can be accesable on the web. The specific dependency I want is svelte. The idea was to mark it as external in the esbuild build and then just copy the dependency into the dist/ folder, see my build.ts file here: ```ts...

Deno + TypeORM

not able to understand this error message same code is working in node
No description

Issue with deno emit bundle in Workspaces - Need Help and Documentation

Hi everyone, I'm having trouble with deno emit bundle function, when my project is in workspaces. It seems like the bundling process doesn't support workspaces. Has anyone encountered this issue before and can provide an example of how to handle this use case? Are there any official docs available that address this? taking example from the official deno workspace docs: https://docs.deno.com/runtime/fundamentals/workspaces/...

Monorepo NextJS import problem

When I try to use NextJS in a Deno monorepo, the package import like import {add} from "@scope/add"; inside the nextjs app throws ...

How do you pass additional options to the code formatter, dprint?

Dprint is the formatter used by Deno, but the options listed for inclusion in deno.json are a tiny subset of those available in dprint. The doc here: https://docs.deno.com/runtime/fundamentals/linting_and_formatting/ says you can "specify custom rules" but never says how. Any insight appreciated!

Is there a way to read the current raw options for stdin?

I want to create an operation that uses raw input from stdin, but then resets it afterwards to whatever it was when the operation started. In other words, if it was already raw, then it should remain raw. If it was not, then it should be reset to be not raw. The same applies for the value of the raw options: e.g. {cbreak: true } In order to do this, I need to read the current raw options. Is there a way to do this?...