Deno

D

Deno

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

Join

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

package.json support not working for prisma

So i upgraded to v1.31 and tried importing PrismaClient from @prisma/client (not using dataproxy) and getting the error as seen in the screenshot

FFI Difference between buffer and pointer

I’ve been using interchangeably Deno.UnsafePointer.of(new Uint8Array()) with type pointer and new Uint8Array() with type buffer. Is there any major difference? Per se I don’t use char[] arrays, just pointers.

Detecting invalid JS strings

Is there any built-in way to "detect" invalid strings? Here's an example: ```ts...

Error connecting to MongoDB Atlas

Hello, I'm trying to connect to MongoDB Atlas via mongoose (npm:mongoose) but encountered the following error:
error: Uncaught MongoAPIError: Server record does not share hostname with parent URI
at resolveSRVRecord (file:///home/farish/.cache/deno/npm/registry.npmjs.org/mongodb/4.14.0/lib/connection_string.js:63:19)
at async file:///home/farish/.cache/deno/npm/registry.npmjs.org/mongodb/4.14.0/lib/mongo_client.js:123:31
error: Uncaught MongoAPIError: Server record does not share hostname with parent URI
at resolveSRVRecord (file:///home/farish/.cache/deno/npm/registry.npmjs.org/mongodb/4.14.0/lib/connection_string.js:63:19)
at async file:///home/farish/.cache/deno/npm/registry.npmjs.org/mongodb/4.14.0/lib/mongo_client.js:123:31
...

interact with deno Extension at runtime

Is there any way to interact with an extension at code execution? I need to pass a pointer from my runtime implementation to a custom extension, but I'm not sure how to manage that.

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