Deno

D

Deno

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

Join

Any good way to modify remote url file and debug it?

For example, I'm using import server "https://deno.land/x/ultra@v2.1.7/server.ts" I want to modify this remote package and debug it with chrome or VScode....

Not implemented: crypto.generateKeyPairSync

I don't understand why I'm getting this error. The code is: ```ts import { generateKeyPairSync } from "https://deno.land/std@0.177.0/node/crypto.ts"; console.log(generateKeyPairSync("ed25519"));...

Cache related headers not included in deno deploy for static file serving

I have a hello world level static site using serveDir. When I run the site locally I see that Weak E-Tag headers are included in responses for the static files and can verify in dev tools that caching works. When I deploy the site with deno deploy I don't see any caching and each request sends the full response to the browser. I can see that compression is running as described in the caching documentation but the docs seem to suggest that if Weak E-tags are included (which I assume is the case since that is how serveDir is behaving locally) that I would expect them in the responses. - Any ideas on why deno deploy is not including caching headers in responses?...

Error with relativ import path after "deno install"

Is it possible that imports in deno.json are ignored after "deno install"?
deno run ./my-cli.ts
deno run ./my-cli.ts
...

Run examples on Windows

Anyone know how to run the Piping to files example on Windows? https://deno.land/manual@v1.30.3/examples/subprocess 'yes' is ignored, and I get a final error for the kill request ```ts...

Python alternative to ctypes, can't figure how to convert a code

Hello, I am trying to convert a Python ctypes code to Deno using FFI, but can't know why its not working ```python...

Suggestions for minimal JSX rendering?

Any suggestions for rendering jsx to a string (or ideally a stream), in the most minimal manner from Deno? I'm currently using preact and preact-render-to-string, but i feel that may just be a bit overkill. I don't need client-side, hooks, or any other preact/react features.

Deno.run Strange Issue

I use Deno.run + stdout/signals/etc a lot, but this behavior is beyond my current debugging abilities I have a command nix eval ... which works fine in a python subshell, and on the commandline. However, Deno.run with piped stdout makes it hang indefinitely. To be explicit, in this block: process.status().then(callback).catch(callback) the callback doesn't run until a .kill() is used (SIGHUP/SIGINT/SIGKILL). Tested on Deno 1.29.4 and Deno 1.22.0 for good measure. What is even more strange is trying to bypass the problem with hackery also fails....

Properly continuously read data from a Reader

What's the proper way to continuously read from a Deno.Reader? I'm trying to parse incoming HTTP2 frames from a Deno.TlsConn, but my current method of reading involves two sets of while loops, one to continuously perform the read operation, and the other, to try read everything currently available to read from the stream in chunks of 16k. Naturally, the while loops make it take approximately one entire core of my processor, which is far from ideal. ...

npm:redis – everything returns `string`?

Every command I try to use from npm:redis seems to have inferred return type string. Look at the screenshot. Surely this command should be returning string[]. Is this not supposed to be working automatically? Anyone tried this?...

Is it possible to compile my app with additional files? Or, setup a config location it looks for?

I'd love the former, will settle for the latter. I found Leaf, but it doesn't seem to work.

My magic middlewares type

If anyone wants a typescript challange here is one: I am trying to create a tuple type which contains an sequence of MiddlewareHandler types. This MiddlewareHandler is defined as: ```ts export type MiddlewareHandler<I = unknown, O extends I = I> = ( req: Request, ctx: MiddlewareContext<I, O>, ) => Response | Promise<Response>;...

Read one byte at a time from ReadableStream

What would be the most obvious way to read a single byte from a ReadableStream at a time?

My deno.lock file exceeds 4000 lines of JSON now

Is this common for application projects? Is there any nice way to clean it up?...

importing packages breaks types

Im importing Receiver from https://deno.land/x/upstash_qstash@v0.3.2. but as soon as i import this package my types are borked

Bug report: deno.land website returns a 500 error for JS files

On https://deno.land, I noticed that the Node vs Deno comparison didn't seem to do anything. From inspecting the network requests, it looks like all four JavaScript file requests are returning a 500 status code. There doesn't seem to be any error messages besides the 500 code....

Deno stopps at file.read()

I am currently working on a way to communicate with a COM device. I can successfully open and read from the COM port. The only problem is, is there is no data on the COM port Deno pauses at that point in the code because the Promise gets neither resolved or rejected. Here is the link to the Stackoverflow problem. https://stackoverflow.com/questions/75400521/abort-promise-after-delay-in-deno...

[Resolved][Fresh] How to load data asynchronously after rendering a page ?

Hi ! I was wondering if someone could help me understand the paradigm to load data asynchronously after a page is rendered. My use case is that I load data from the backend, reading some folders and retrieving git information. It takes a few seconds so I don't want to wait for the whole information before rendering the rest of the page. My code runs well if I do that synchronously but I don't understand how to do it after the page render. Should I use a component ? An island ? I don't understand well which code is executed on the server and when so it's not easy to troubleshoot, and I couldn't really find any examples that do something similar. I did a post here with more details but maybe it wasn't the right place for it : https://discord.com/channels/684898665143206084/991511118524715139/1072518216728977489 Any help would be appreciated, cheers !...

Supabase Auth UI in Fresh

I'm building a simple web. I'd like to use Supabase's Auth UI, namely the Auth component, for handling the login and signup forms. I'd like to get the following working: ```ts import { Auth } from "https://esm.sh/@supabase/auth-ui-react@0.2.6"; import { createClient } from "https://esm.sh/@supabase/supabase-js@2.7.0?alias=react:preact/compat&deps=preact@10.12.0"; ...

Any tool that will complie my TS code to JS?

I have coded a website in typescript using Deno, but I want to convert it to JS code. I know the Deno runtime does it automatically for me but I want to convert my codebase permanently to JS. Is there any tool I can use to do that?