Deno

D

Deno

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

Join

Transitive dependency module not found?

I am using Deno 2. When I use this import: import { plainToClass } from "https://deno.land/x/class_transformer/mod.ts" and run my project, I get this error:...

deno run fail to execute npm binary file in 2.0

Describe the bug Hi there, Andrew from supabase, we've been having report of users failing to use supabase CLI with Deno 2 and running into some error executing the compiled binary. To Reproduce Steps to reproduce the behavior:...

Converting package.json into deno.json

Is there any documentation about what properties deno.json have and what are the expected values? I'm unable to find any. I would like to put as many things as possible into deno.lock from the package.json. This would be really helpful....

How to install npm dev dependencies?

I try to install keysely-codegen using deno add -D npm:kysely-codegen but everytime it adds the dependency to my regular imports in the deno.json, which looks like this: ```javascript { "nodeModulesDir": "auto",...

deno lint doesn't notice function call to unimported function

if I put "foo()" into test.js and run "deno lint test.js" I was expecting it to say "function foo() is not defined" or similar??
No description

Dynamic KV queue listener removal

It is possible to add listeners dynamically, but it seems impossible to remove them. I am creating listeners dynamically to process incoming messages from incoming WebSocket events. Each WebSocket client has an ID, and I want to create a queue dynamically for each ID when it connects, then process items in each queue sequentially to avoid concurrency issues arising from multiple rapid messages being received from the same client. However, if the connection is lost, I will need to create a new listener with a new WebSocket instance, so it can continue to process messages on the new connection. ...

kv#listenQueue logs ""KV Connect does not support queues" and errors when the listener is triggered

The error is: ``` error: Uncaught (in promise) Error: Enqueue operations are not supported in KV Connect. await kv.enqueue(incoming); ^...

deno install error for Nextjs Project

I'm using Deno 2.0.6 for now. But after I created Next.js app with create-next-app, I cd into the folder, deleted node_modules folder and run deno install --allow-scripts to re-install all modules with deno, but it give me the following error below: ``` error: script 'install' in 'sharp@0.33.5' failed with exit code 1 stderr:...

Piping two TCP connections to each other

Hey, I'm messing around trying to create a proxy in deno. I want to take an incoming connection, use some logic to decide how to route it, and then create an outgoing connection to pass it to. I have some code like this right now: ```ts...

auto import in VSCode/Zed (general LSP support for auto importing)

Hi all. I'm working with a fresh Deno project in VSCode and can't seem to get import autocompletes to work. All other LSP functionality seems to be working correctly. I have the following deno.json ```json { "tasks": {...

Docs on deno cache

Hi all, I’m confused about the state of the deno cache subcommand. It seems that the online docs are redirecting to deno install now, but $ deno help cache still gives info in v2.0.6. Is deno cache going away, to be replaced by deno install?

How to get User Information (or access token) for a oAuth session leveraging deno_kv_oauth and Fresh

It looks like the demo for Auth0 and Fresh linked on the deno_kv_oauth denoland page (https://github.com/denoland/fresh-deno-kv-oauth-demo) uses v@0.6.1 which is older than the current version of v@0.10.0. When trying to use v@0.10.0 it appears there were a bunch of breaking changes but no update to the demos or docs on how to leverage those changes or port the code. The shared plugin in fresh.ts was removed, but guidance was provided how to write and include your own, so no issue there. However, it looks like getSessionAccessToken has been removed, as well as any way to get information about the OAuth session itself (if I could get the access token I could get the user information from Auth0's own APIs.) In looking in JSR, kv_auth is v0.11.0, no idea if anything has changed between that one and the one on denoland. If I force everything to v0.6.1, I can get it to work with the old APIs. Is that my only option right now?...

How to resolve this?

Whenever I use npm install, these errors that seem to be related to deno somehow appear. Any thoughts? command: npm install vite @=Ingalless=...
No description

How to install deno with auto yes?

I am creating a setup script, and part of the installation process involves answering the question 'Do you want to edit shell configs to add Deno to the PATH?', which prevents my script from proceeding to the next task.

Intellisense not working for typescript react.

I ran this to create a new Vite React project: What I did: ``` deno run -A npm:create-vite@latest --template react-ts deno install...

AbortSignals not working in Deno

Hi there, I'm trying to create a Hono server with a disconnect handler. When I cancel the request from my client, the abort signal from the raw Request object never changes to true. This code works on both Hono and Bun, so I think this is an issue with Deno's fetch API. See example below (requires Hono) ```ts import { Hono } from 'hono'...

Is there any way to limit write access of the `deno run` execution to its `Deno.makeTempDir` calls?

At the moment, the only way to enable Deno.makeTempDir() seem to either using --allow-write (writing to any file/dir path), or explicitly creating and maintaining a root temp folder and update all Deno.makeTempDir calls with a { dir: $MY_ROOT_TEMP_DIR } option. If there was a way to access the effective global temp root of Deno on the system, at least we could start with --allow-write=DENO_TEMP_ROOT, where DENO_TEMP_ROOT would be set via a deno call. Can anyone think of any other options here?...

Start a new Vite React project

Hi! Should https://docs.deno.com/runtime/tutorials/how_to_with_npm/react/ work out of the box? I am trying to get it to run with vscode but even if it runs there are a lot of small problems with it out of the box: - svgs are not recognized as valid resources - the react UMD is missing so everything is recognized as an error - doesn't generate a deno.json for me at all...

How can I do simple image recognition with Deno?

It's some very simple recognition, i don't need to recognize cats or dogs or people, just a few set of images within a bigger image and the quantity of each. Imagine counting the totals of a loot drop in game. It's that simple....

Skipping time in tests; time delay setTimeout setInterval

(the title is just so people can get to this one easier by using search) I have a deadline/delay based (@std/async) functionality and in tests I want to skip time (so I don't have to pass lower values for timeouts). I want something like jest's advanceTimersByTime...
Next