Deno

D

Deno

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

Join

How to debug multiple worker modules in vs code

Hi, what is the best way to debug a deno program with lots of workers? I have around 6 workers, and found it very difficult to debug because first in vs code, it didn't show all the workers; is there a way to view/debug/pause/resume all workers in vs code?. Using chrome inspector/devtools, it showed the workers, but then it was very difficult to debug because it opens each worker console in a separate browser window and also required to pause each worker separately manually. So switching around...

Clean Integration of a Multi-file Deno Project as a Dependency in another Deno Project

Hey everyone, I’m facing an issue integrating a multi-file Deno project into another Deno project. The challenge is that the files I need to import have their own internal imports, which makes the usual GitHub URL method unfeasible. I’ve already tried using the dnt approach. It works fine when there aren’t many npm packages involved, but once the dependency graph gets heavier, I start running into odd build errors. My goal is to ensure that everything exported from the project's mod.ts (which just aggregates a bunch of export statements) is fully accessible in the consuming project. Has anyone successfully tackled this scenario? What is the cleanest and most reliable method to use a multi-file Deno project as a dependency within another project?...

How to use Deno KV when deploying Next.js to Deno Deploy?

I do not see a straightforward way to use Deno KV inside a Next.js project deployed to Deno Deploy: - Deno.openKv() won't work -> Deno is not found. - import { openKv } from "@deno/kv" + await openKv("URL") won't work either -> The Next.js app just won't build with this dependency. ...

Deno and Eta browser-side?

Sorry if I'm missing something obvious, but how do I make Eta available from the browser? I import it for server-side work but don't know how to access it from browser-side js files. I tried a bunch of stuff but get errors about modules. Is there a recommended way or tool to bundle node_modules up with Deno? The docs have a ton about Svelte, React, etc., but I'm pretty vanilla.

how do I access post data in a deno http server?

Hi y'all, I am perfectly aware that it may be my limited knowledge on the JS eco system, but I have not found a warking way to access POSTed data in a deno http Server. What do I have to do here?...

DB Connection slow with mongodb

Hello im working in a new project to start use Deno, but the connection to mongo is to slow, almost a minute, i try the same in node and it was faster, i dont know why takes more time in deno , anybidy with this same problem? The uri is just test, it works, bue slow....
No description

Cannot copy files from `AppData/Local/` despite --allow-all flag

Description When attempting to copy a file from AppData/Local/ using @std/fs in Deno, the operation fails with a PermissionDenied (os error 5). This occurs even when running Deno with the --allow-all flag. Code Sample ```TS...

Deno imports failing to load

I'm making a Svelte + Deno project. I'm currently trying to use jsr:@std/encoding@^1.0.7. Every time I try to use the package I get the error seen below. This happens with most deno packages that i try to use, where it says some file is missing. It doesn't fail when using npm:@oslojs/encoding@^1.1.0 or npm:@deno/vite-plugin@^1.0.4. I guess it's because they're npm and not jsr or deno. It also happens for packages such as https://deno.land/x/jose@v5.9.6/index.ts. I've tried running deno clean then restart my pc and create a new project. It still happens there. A friend of mine does not have the problem, when running the exact same project as me....

Help compiling preact

Here's my current setup: ``` // deno.json { "imports": {...

databaseBindingMismatch when trying to promote a deployment to production

Since recently, I can no longer promote deployments to production via dash.deno.com. Every time I try, I receive the following error message:
{"name":"ApiError","status":400,"code":"databaseBindingMismatch","traceId":"****","retryAfterSec":null,"message":"The requested deployment is binded to a different set of databases than the current production deployment."}
{"name":"ApiError","status":400,"code":"databaseBindingMismatch","traceId":"****","retryAfterSec":null,"message":"The requested deployment is binded to a different set of databases than the current production deployment."}
I've asked about this before in #general and opened an issue but I couldn't find anything that worked. I want to avoid deleting and starting all over again with my project if it's possible...
No description

Deno Kv: "Database is locked" on enqueue

I'm running 2 Deno services. Service 1 gathers info and posts it to service 2 via HTTP post, where 2 immediately offloads the request to a Deno.kv queue and returns. There are a lot of posts being made, and once a couple thousand events are queued I'm noticing that inconsistently service 2 will throw the following error: ``` [uncaught application error]: TypeError - database is locked request: {...

Importing pdfjs?

Hi, I’m trying to figure out how to use pdfjs with deno. There seem to be several related packages on npmjs.com: https://www.npmjs.com/package/pdfjs...

globalThis woes with VSCode Deno extensions LSP

I'm having a hard time with the LSP 🤯 I have this code, which completes successful: ```ts import { Debug } from "mods/Debug";...
No description

I run "deno -A npm:drizzle-kit generate", deno hits me with "Cannot find module 'drizzle-kit'"

Hello everyone, I'm pretty new to deno and I've been building an express app with drizzle as my ORM. The problem is, I can't seem to generate migration files with the deno -A npm:drizzle-kit generate command, instead deno throws an error Please, can anyone help me? I've been battling this since yesterday, claude couldn't even provide a solution, here's the error deno give me: `Reading config file "C:\Users\me\Desktop\backend\drizzle-app\drizzle.config.ts"...

VSCode only TypeScript Errors, nothing from Deno LSP

Hey, I've just restructured my pnpm workspace into a deno workspace. The Server and everything works already, but the vscode stuff isnt already. I've run >Deno: Initialize Workspace Configuration and I have a .vscode/settings.json, with this content: ```json...

deno task setup can't run on Windows 11.

So I just downloaded an ongoing project that was created on Mac. I am currently working on windows 11 and when I run the command "deno task setup" I get this error. C:\Users\xxxxx\Documents\GitHub\xxxxx> deno task setup Task setup ./tasks/setup.sh Error launching './tasks/setup.sh': %1 is not a valid Win32 application. (os error 193)...

`.svelte` file intellisense can't properly resolve imports in a Deno only project

I have a Deno workspace with: - a shared member which in the deno.json has "name": "@scope/shared" - a client member which is Vite+Svelte and only uses Deno (no package.json) everything works and builds perfectly fine however:...

"window" global issues using the p5.js library in a Deno / Fresh project

Hi I'm trying to use the p5.js library to make a little game on my site that uses Deno and Fresh. I tried directly using the p5.min.js download, the p5.js NPM package, and this p5 wrapper that says it's compatible with Deno / TS: https://jsr.io/@kaleidosium/p5-wrapper-ts. All of these result in the same "window is not defined error" coming from p5.js because p5 is trying to use the window global and i'm wondering if there is any way to fix this. I was thinking to try replacing the window calls in the p5 file but it's transpiled into an illegible form of js. It's also strange that the p5-wrapper package says it works with Deno so I'm just wondering if there's something i'm missing here, or another way to use p5 with Deno. Might just try importing with a CDN next or just using Three.js for now. Thanks!...

Resolving Dependencies for Local ESM NPM Packages in Deno

Hi Deno Community, I'm seeking guidance on the best approach for a setup involving a Deno application and a local, unpublished npm package using ESM. I'm having trouble with Deno automatically resolving the npm package's dependencies without explicit declarations in Deno's config file. Here's the project structure: ```text local_module/...

fix library version of a dependency

Putting this to deno.json ```json { "imports": { "gcp-metadata": "npm:gcp-metadata@6.1.0"...
Next