Deno

D

Deno

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

Join

Using Deno's Jupyter Kernel, can I profile my code? If possible, line by line profiling?

Similar to python's line_profiler module, is it possible to profile my typescript code line by line in a jupyter notebook?

Getting svelte-language-server/typescript-language-server to recognise deno workspace packages?

Attempting to get svelte kit going in a monorepo and what i hope is my last roadblock is having the svelte/typescript language sever recognise my local workspace packages. ``` deno.json packages...

Stubbing @std/x

I need some help understanding how to use the stub() method with @std/x libraries. ```typescript import * as stdYaml from 'jsr:@std/yaml';...

Read file as text in JSR package (easy with NPM, not Deno)

I'm writing a JSR package. My problem boils down to; I want to read a file (that is part of the package) as text, within a script (also part of the same package). I can get this to work fine if I use NPM to install this JSR package, but in Deno it does not work; the import.meta.url inside the script that needs to read the text file resolves to a https://jsr.io/… URL, whereas the text file is presumably ready to be read on the user's machine given the package has been installed. How do I read...

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)...