Deno

D

Deno

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

Join

Specifying config remotely or jsx on install

I'm struggling quite a lot here. I originally recommended using this command:
deno install -Afr --config https://deno.land/x/pyro/deno.jsonc -n pyro https://deno.land/x/pyro/cli.ts
deno install -Afr --config https://deno.land/x/pyro/deno.jsonc -n pyro https://deno.land/x/pyro/cli.ts
but it turns out deno doesn't support loading a remote config? That seems strange to me but sure. To work around this, I'm trying to do:...

Is it possible to know what version of a dynamically-imported module was just imported?

Right now, you can run code like import('npm:lodash'), which will get the latest version of lodash. Is it possible to know what version of lodash that resolved to, in the runtime or elsewhere? I suspect that it writes to an import map if there is one?

Why am I getting an "Uncaught DOM Exception" in the Deno CLI?

To replicate: 1. deno in the command line to initialize a Deno REPL ``` // Get an array of random bytes const arr = new Uint8Array(32)...

Better way to allow downloading of files besides serving entire file

I'm trying to allow users to download files that are in a private folder which cannot be accessed publicly. A special key is provided which allows them to download the file. Would I have to put the file into a public folder that can be accessed directly through a browser, or is there a way to use a router to serve files? I'm currently using a router to serve entire files to the client, but this creates a delay since some files can be gigabytes large and the site hangs while the file is being read + sent. I've attached a pic of how I serve files, any help would be appreciated! If I need to make a public folder called "download" instead, I can....

Share state between islands

Hi. How could I share state between island. E.g. shopping cart. I click on add product and in some other component I show the current status of the number of items in the cart. Thank you

Islands not working with Cloudflare DNS proxy

I have deployed Deno on a remote server with nginx-ingress-controller that offers self-signed certificate. If I connect to the server directly everything works fine (Cloudflare DNS without proxy). But if I turn on Cloudflare DNS proxy (Full SSL/TLS - Encrypts end-to-end, using a self signed certificate on the server), the islands codes don't run. ...

Update sub-directory for module already added to deno.land/x

The title pretty much says it all, but the module in question is hot_mod, and the current subdir is src/modules but I want to change it to '' (empty string)

Should we, or how should we, use Deno as a sandbox for untrusted code?

I've been using Deno in this context because of some of the nice security model features. However, it's been tricky hitting snags with the model. For example, user's code runs in a WebWorker and has a specific environment with limited access to APIs. But there's no permission to enable/disable the creation of new Worker objects, so people can create a worker in the worker that has access to raw APIs. Is there a right way to do this?

deno_bindgen type error: deno-ts(2345)

Anyone else getting this with deno_bindgen?
Argument of type 'bigint' is not assignable to parameter of type 'PointerObject'.deno-ts(2345)
```console $ deno --version deno 1.31.1 (release, aarch64-apple-darwin)...

Using Rust FFI in a public Deno module

I'm writing a Deno module that I intend to publish on deno.land. It will be using a Rust library (public crate) via FFI. Are there any examples on how to do this properly?

Publishing to deno.land/x: GitHub webhook says it's delivered?

I followed these directions (https://deno.land/add_module) to publish a 3rd party module to deno.land/x. On GitHub, the most recent run of the webhook, I've got a 200 response with:
{"success":true,"data":{"module":"hot_mod_server","version":"v0.0.1","repository":"patreeceeo/hot_deno","status_url":"https://deno.land/status/9af0c7c9-0ee4-499d-9ada-d3a27e6ccc15"}}
{"success":true,"data":{"module":"hot_mod_server","version":"v0.0.1","repository":"patreeceeo/hot_deno","status_url":"https://deno.land/status/9af0c7c9-0ee4-499d-9ada-d3a27e6ccc15"}}
...

Deno ts

Whenever i run my deno file using a ts config like this documentation describes: https://deno.land/manual@v1.31.2/advanced/typescript/configuration i get the unsupported compiler options...

Nvim deno tsserver conflict

my language servers are conflicting when i open a deno project, if i use LspInfo i can see both deno and tsserver are setup on the buffer. here is what i have on my lsp config: ```lua nvim_lsp.denols.setup({...

Deno Docker - deno run --watch file.ts

I am on a macbook m1, and i tried to dockerize deno from the official image and whenever i try doing --watch on the cmd i get Function not implemented (os error 38)

how convert file to another format?

I’m playing with openai in deno using openai_deno and I’d like to know to convert an ogg file to whisper’s supported formats. First of all, the ogg files are from remote links and I use the native fetch api to get their contents then I use ‘new Blob([data.buffer])’ to transform the fetch file into blob. I even added ‘{type: ‘audio/wav’}’ but whisper still rejected the format...

WebSocket subprotocols

This might be a bug: Deno's websocket implementation seems to have issues with subprotocols (RFC section on subprotocol). I was using one initially, then I removed it and that issue seems to be resolved. With the subprotocol, since the one returned by Deno.upgradeWebSocket does not include the sec-websocket-protocol header, and response headers are immutable, I was instantiating a new Response instance, copying over data from the response returned by upgradeWebSocket and adding the sec-websocket-protocol header. Even then, the websocket in Deno never opened and all of its properties including readyState would remain undefined indefinitely. The browser was happy, though: its websocket instance's open event was firing, only the server never could use its websocket instance. I removed the subprotocols parameter to the websocket constructor and the code on the server handing it and now the server's websocket is opening and messages are flowing. ...

How can I create a linked [ReadableStream,WritableStream] pair?

Hi, I have a function A which accepts a WritableStream and another function B which accepts a ReadableStream. How can I plug them into each other so that the writes from function A will be given to function B? In NodeJS this could be accomplished with an NPM package like https://github.com/indutny/stream-pair....

how to use esbuild_deno_loader for local file?

i have [join(tmpDir, './bundle.js')] as entry point (resulting as string e.g. c:\Users\User\AppData\Local\Temp\tempdir-33c4f2f8\bundle.js, but that gives me a Do not know how to load path error on console? what am i doing wrong?...

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.