Deno

D

Deno

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

Join

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?

How to get remote IP address when using Deno.serve?

I'm using connInfo when using Deno from STD but the native http server doesn't seem to have such interface, since it's undefined via the handler.

Two questions on documentation

RTFM in 3... 2... 🙂 Question 1: How do i hide documentation for specific exports, i do not want to document exports of dependencies, like https://deno.land/x/entsoe_api_client@0.5.1/deps.ts . I tried /** @ignore */ to no avail...

Is there any simple way to keep track of the heap/stack usage of a running Deno application?

I have made a Deno application and I'm curious to know if there's heap/stack issues that I should fix. I use a lot of promises with some recursion.

Deno-lint shows an error on the event type. (which shouldn't be)

Here is the full thread about it: https://discord.com/channels/684898665143206084/1050387276322058311 I use JSX.TargetedEvent<HTMLInputElement, Event> as the type of event. It works perfectly when I run it, but deno-lint still give me this error when I use event.key : Property 'key' does not exist on type 'TargetedEvent<HTMLInputElement, Event>'. Is there anyway to fix it?...

using data from one deno bench in another

is there any good way to re-use the results generated in one deno bench in another one? example: ```ts...

docker compose up of Oak server throws: SyntaxError: Duplicate export of 'type'

I am just learning how to use Docker, and am trying to put up a container of an Oak server. When running docker compose up, it throws the error mentioned above. This doesn't happen locally, or on Deno Deploy. I'm not really sure where to start? Can I somehow ignore this error, or is it actually a problem? ...

Publishing Deno Module with Bin (Answered)

I know there's a way to include a bin/ when publishing a module and then perform some kind of deno install https://module-url because I've used it before. But now that I'm searching for it, "bin", "executable", and the like only turn up docs on deno compile. I remeber there was an example installing curl.ts (https://deno.land/std@0.168.0/examples/curl.ts) but I can't seem to find that example either. Could someone point me in the right direction?

Use local tgz file instead of tgz from npm registry

Hello, Is it possible to reference a local tgz file inside a deno project (like calling npm install my-lib-1.0.0.tgz)? I'm working on the open source library https://github.com/dreamit-de/graphql-server/ on a PR to make it possible to use the library in Deno. I would like to test if a change is working so my idea was to create a tgz file with npm pack, add it to an example Deno project and see if it runs in Deno....

vscode LSP being a disgraceful little bitch

for no reason obvious to me, vscode and deno's lsp has been acting up lately. any ideas what could be the reason? i haven't done anything special that i'm aware of. ```` successfully cancelled request with ID: 3290 Unable to send result to client. client asked to cancel request 3314, but no such pending request exists, ignoring...