Deno

D

Deno

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

Join

Date-fns typings don't work?

I'm trying this code: ```typescript import { startOfDay } from "https://esm.sh/date-fns@2.29.3"; ...

window variable in fresh islands

How do I access window in islands? I need to modify DOM code client side.

Warning Implicitly using latest version (0.178.0) for...

Hello - Deno newb here. When running deno task start I get "Warning Implicitly using latest version (0.178.0) for https://deno.land/std/node/events.ts" The error below is then thrown which makes sense because https://deno.land/std@0.178.0/node/events.ts is a 404. `error: Uncaught (in promise) TypeError: Module not found "https://deno.land/std/node/events.ts"....

How to prevent std/http from gzipping and overriding Etag

It appears deno std/http applies gzip content-encoding magically sometimes depending on the type of data served. This is unexpected to me, will override manually set Etags with a weakly validated one, and it seems there is no way to disable this behaviour. Or is there? If I create a Github issue about this, should it go to deno_std or does this behaviour come from underlying http impl code in deno core?...

Fresh in a Docker exiting process

Not sure whats going wrong. Works fine on deno deploy. But when trying to run it inside a docker container the process exits shortly after starting. https://github.com/Robspin/deno-fresh-blog ...

eval script with stricter permissions in deno

Hi all, I wanted to know if its possible to eval a script in deno with more strict permissions. Something like vm.runInNewContext in node. At best, I think I can use Deno.Command('deno', {args: ['run', 'user-script.ts']}) right now. However, that means allowing any deno process to be ran at any time from the parent script. I am wondering if there is any way to specifically run a script with a subset of the permissions allowed to the parent script

solid-js with Deno

I was wondering if it was possible to use solid-js with Deno natively without something like esbuild. This is possible with react (with no config): ```tsx import * as React from "https://esm.sh/react@18.2.0" function MyComponent(props: {name: string}) {...

Feature Suggestion: Dark Mode for `std` library Docs.

Deno's documentation is great. I find myself reading it more and more. I currently use a browser addon called Midnight Lizzard to turn it Dark. It works great but since Deno's site is made in Tailwind I was wondering if the devs could add a simple Light/Dark Toggle button on Top Right of the page where you usually see them. It would be great on the eyes for long reads and overall.

Running esbuild with esbuild_deno_loader

I've spent probably four or five hours trying to track down this issue, to the point where I actually started tweaking and rebuilding old versions of esbuild to try and reproduce this bug without the help of a plugin. I have no idea. I want to find what version this started happening in to file a bug report (because I think it's an esbuild issue), but I haven't had the time to do that. Here is the reproc code (it only errors with wasm): ```ts import * as esbuild from "https://deno.land/x/esbuild@v0.15.10/wasm.js";...

`fetch` request always fails once

Hello, I got a script containing a fetch request. Once in a while, it throws the connection closed before message completed error. But always works at the second and next attempts. How's that possible ?...

Sequentially write to TPC connection

Hey, I experience errors when multiple async functions write to a TCP (Deno.Conn) connection. How can I make sure my data is sent fully, even if it can't be written to the send buffer in one function call? Using this code, I observed data (buf) being written partially, then data from other async functions being written before the remainder of the partially written data is written. ```...

Deno process watcher. How?

This code when compile, runs a simple http server.
import { serve } from "https://deno.land/std@0.178.0/http/server.ts";
serve((_req) => new Response("Hello, world"));
import { serve } from "https://deno.land/std@0.178.0/http/server.ts";
serve((_req) => new Response("Hello, world"));
...

monaco-editor on fresh

Hello. First of all, I am a newbie in web development. I played around with Deno for a while. So I thought I will leverage it to finally get into web development via Fresh. For a toy project, I am trying to build a code playground (like, https://play.yew.rs). I want to use monaco-editor(https://www.npmjs.com/package/monaco-editor). But monaco-editor works with HTMLElement (https://microsoft.github.io/monaco-editor/docs.html#functions/editor.create.html), instead of Preact. I could make it work as a static code(https://github.com/rnbguy/fresh-playground/blob/264e11813d549fe91b7bf2be38b454610bc5c676/components/Playground.tsx), but I need to add code in the island components to get the value from the editor using monaco API(https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.ICodeEditor.html#getValue) here - https://github.com/rnbguy/fresh-playground/blob/264e11813d549fe91b7bf2be38b454610bc5c676/islands/Run.tsx#L12....

deno in Dockerfile

i have successfully installed deno with theese commands: ``` install denojs RUN curl -fsSL https://deno.land/x/install/install.sh | sh ENV DENO_INSTALL /root/.deno...

could not find npm package for

I'm trying to make Hardhat CLI work with Deno but I stumbled upon this error which comes from Deno: I initialized a new hh project pnpx hardhat init then installed hh as a deno binary: ```sh...

Microsoft Transact SQL

Is there official Deno driver for this or a recommended way?

Remove std/node, it was merged into Deno itself (#3206)

This used to work, but now it doesn't. Where do you show examples of where this was moved to and how to use it from now on? ```ts import { inflate } from "https://deno.land/std/node/zlib.ts"; import { Buffer } from "https://deno.land/std/node/buffer.ts";...

AssertionError: Test case is leaking async ops

- 2 async operations to op_read were started before this test, but were completed during the test. Async operations should not complete in a test if they were not started in that test. | | - 1 async operation to op_spawn_wait was started before this test, but was completed during the test. Async operations should not complete in a test if they were not started in that test. I have sanitizeOps: false, sanitizeResources: false and yet I get this error? I'm 99% sure this is from npm:prisma aka I don't have control over it. I just need to figure out how to get this error to go away or my tests wont pass :/...

Why does `deno test` add an older version of the `std` library to my deno.lock?

My testing files do not reference std/0.165 and my import-map.json is pinned to std/0.177. When I use deno run everything works fine. When I use deno test for some reason std/0.165 is added to my deno.lock file and then I get errors about core.runMicrotasks is not a function. How do I keep deno test from adding an older version of std to the deno.lock file?...