Deno

D

Deno

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

Join

Vite + Codemirror in SvelteKit 4 broken due to @codemirror/state being loaded twice

I am trying to migrate the SvelteKit project from Node to Deno, and this issue is preventing me from switching over. The npm modules installed alongside SvelteKit 4 needed to reproduce are codemirror @codemirror/lang-json I would imagine that being able to change the .deno directory to somewhere outside of node_modules would fix this....

where the env vars of deployments deployed through Deploy REST API are stored?

Hey there folks, have a question. Using Deploy REST API, we can create brand new project (& deployments) and pass it environment variables, then on every request the isolate has access to them. Now, the question is, since they are persisted, where these variables are visible and where they are stored? Cuz i don't see them anywhere in my account/project/deployment info, which is good for my use case. How are they protected? Who can see them?...

Web Cache Limit?

Does cache size grow unbounded or is there a way to autoevict (LRU or something)? https://docs.deno.com/api/web/~/CacheStorage#method_open_0...

CORS problem with my deno web server

I wrote this tiny websocket server in deno: ```Deno.serve((req) => { const webSocketUpgradeRequested = req.headers.get("upgrade") === "websocket"; if (!webSocketUpgradeRequested) {...

Init KV data in Fresh from JSON

Hello guys. I'm trying to init data from JSON file to Deno KV in FRESH, where should I add this code? is it right in main.ts?...
No description

Build an app with TanStack and Deno

I'm attempting to following along with the example at https://docs.deno.com/examples/tanstack_tutorial/ and I'm unsure of where to start. I ran deno run -A npm:create-vite to start a React app (which isn't explicitly included as an instruction in this doc). The first real instruction is at "Start with the back API". Am I just creating am "api" folder inside of my React app? If so, I did that and ran the next instruction, deno add jsr:@hono/hono in my app (inside of the "api" folder) and I keep getting error: npm package '@jsr/hono__hono' does not exist. Can someone tell me what I might doing wrong and what the literal first step is? Is not to just create a React app (by any means necessary)?...

Debugging Worker modules in VS Code

Hi, I have set a breakpoint in the worker module, but it doesn't get hit in VS Code. Any ideas? Could you please inform what confits/settings need to be set or whether it is not possible at all using vs code?

[VSCodium] - Deno task list

Anyone know how to enable the task listing in Codium ? Mine stays empty......
No description

emit in Deno 2.0

I am building a distributed app that uses websockets to synchronous several "devices/browsers". On the backend I have a webSocket server that passes messages to all clients. The client themselves have a very simple UI. Becuase of their simple structure and only commonality is sharing of a class that maintains the webSock back to the server, bundleing seems unnecessary. However I can not find "emit" in deno 2.0. If I just want to transpile files and put them in a public directory for the fro...

deno_blog is broken

Hi! Not sure if deno_blog is still maintained since it's last commit was 3 months ago, but there's an error I'm encountering. I used this command to create my blog: ``` sh $ deno run -r --allow-read --allow-write https://deno.land/x/blog/init.ts ./directory/for/blog/...

How to import GoogleAIFileManager from @google/generative-ai/files

I am new to deno, I am trying to import GoogleAIFileManager from : @google/generative-ai/files, but it is impossible to me 😦 ```ts import "jsr:@supabase/functions-js/edge-runtime.d.ts" import { GoogleGenerativeAI,...

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