Deno

D

Deno

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

Join

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.

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}) {...