Deno

D

Deno

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

Join

Strange behavior of the assertRejects() method.

Behavior of the assertRejects() method. assertRejects() fails when a non-stubbed method is called before the stubbed method. ...

Module loading

Hey, I am just testing the deno_core. I know, that the deno runtime with the command line supports native executing of ts files and also loading of dependencies by an url and also npm depependcies out of the box. As I evaluated it, the deno_core does not support this by default, so how to easily implement executing ts files and loading of depencies by url? I already found, that I can set a custom module_loader and a custom_module_evaluation_cb for the JsRuntime, but I think there is an easier way to do this instead of integrating it by myself. Thanks for you help...

Can I use deno_ast to transpile arbitrary typescript?

I'm just wondering if it's safe to use deno_ast to transpile arbitrary (user-generated) typescript to javascript.

`deno cache` with `node_modules_dir` moves sub-dependencies into `.deno/node_modules` dir

If I execute deno cache --node-modules-dir package-lock.json, a node_modules directory is created - which is fine. But all sub-dependencies are downloaded into node_modules/.deno/node_modules. Unfortunately esbuild can't find these sub-dependencies as they are not where they're expected, as they should be directly in node_modules. Is there a way to tell deno to put all dependencies and sub-dependencies directly into node_modules?

deno options not available in vscode debugger options

latest vscode, latest deno, yes ive got the extension installed
No description

Can I add properties to a websocket object?

``` console.dir (socket.id) console.dir (socket) Object.assign (this.control.id, socket.id)...
No description

Deno + Vite + React + VSCode

Could someone help me setup VSCode so that it recognizes React JSX without red squiggles? Also, is it possible to setup type reference for image imports from vite? I have been at this for a couple days and still can't figure it out......

Deno_bindgen

I'm super happy to see the Deno NPM compatibility supporting an FFI call using Rust's NAPI crate for a npm package I just made. I'd like to make a first class Deno TPM, is deno_bindgen ment to be installed as a crate within the FFI binding project or cloned and have the binding code moved into the cloned repo? The first seems more logical for me but I had some problems just executing simple binding generation. I can post a more specific error if its needed.

KV read count

Do kv.list and kv.getAll count as a read for each value or a single read for the operation?

Undefined IP on requests

I'm using express and mongo on Deno, and i'm also trying to use express-rate-limit, however, i'm getting the following error on rate-limit because the request.ip is undefined: ```js ValidationError: An undefined 'request.ip' was detected. This might indicate a misconfiguration or the connection being destroyed prematurely. See https://express-rate-limit.github.io/ERR_ERL_UNDEFINED_IP_ADDRESS/ for more information. at Object.ip (file:///node_modules/.deno/express-rate-limit@7.1.5/node_modules/express-rate-limit/dist/index.mjs:97:13)...

How to use `f-partial` from Fresh?

Show me an example of using f-partial in a Deno Fresh project.

KV watch initial value

Does KV watch always trigger an initial read of the current value? Is there a way to only watch for changes without the initial read?...

The deployment failed: Relative import path "$fresh/server.ts" not prefixed with / or ./ or ../

When deploying I get this error:
Deploying... (100.0%)
Error: The deployment failed: Relative import path "$fresh/server.ts" not prefixed with / or ./ or ../
Deploying... (100.0%)
Error: The deployment failed: Relative import path "$fresh/server.ts" not prefixed with / or ./ or ../
...

Deno Deploy: Timeout Page

Is there a way to replace the standard deno deploy timeout error page? I have a use case where I allow users to upload images and rather than try to impose some arbitrary limit on the size of the images I'd rather just give them a more accurate error message when the request times out.

Fresh, deno deploy microservices and auth

Hi, I want to design a Fresh frontend and api working with deno microservices and auth. My proposal is on the scheme. Is it the best way to manage auth between microservices ?...
No description

EventSource vs Multiplex webook

I am setting up an system that needs realtime updates for potentially 100+ different resources on a page. Unfortunately, I'm not familiar with how Deno Deploy handles EventSource connections So, based on Deploy infrastructure, would it be advisable to use 1-1 EventSource for each resource?...

rusty_v8 - how to pass data from js/v8 into rust

Hello, I am playing with rusty_v8, by following the examples I was able to get js eval up and running quite nicely. Now, I am trying out Function/FunctionTemplate stuff and I tried to do this (simplified and wrong): ```rs...

Deno deploy - My simple mail service is giving a connection error (works fine locally or on vercel)

As the title states my small email sending API is not working on deno deploy. Maybe there needs to be additional configuration or there are some limitations to deno deploy of which I am unaware. I am using nodemailer as my mailing service. This is the repository https://github.com/Robspin/deno-mail-api...

How to send data from a child component to its sibling?

I want create an app with two forms, each form in its own component. Users type in form 1, then the data will be passed to component 2. In there it will join the data of what they type in form 2. How can I do this? Below is the code on my machine, taken from the answer from the same question in Stack Overflow. It works when using React on Stackblitz but I don't get why it's not in my machine: index.jsx ```js...

Can Deno list all functions within a script without explicit registration or annotation?

. For context, here is how you do it for globalThis: ```ts Object.getOwnPropertyNames(globalThis) .filter((item: string) => typeof (globalThis as any)[item] === "function")...