Deno

D

Deno

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

Join

Support for auto-accessors

I'm playing around with Decorators, it seems like with "experimentalDecorators": false, there's a problem with the generated JS if I include the new accessor keyword. It doesn't get down-leveled in the generated code, which is what I want to see (since I'm targetting the browser).

Rust sdk register_actity_type

Hey, I am using the core_sdk in rust. I registered an activity, which should be able to consume following ts type: functionName: string, parameters: any, second: any (data attached in screenshot). My rust code: worker.register_activity("echo_activity", |_ctx: ActContext, parameters: Value| async move { (Value is from type of serde value) If I use the code above, parameters is just the data of second -> { "second": true}, so the last object in the array data is parsend into parameters. I also tried to use Vec<Value>, but then the activity just stuck and nothing happens. I also got no error and the workflow is also stuck in state Running...
No description

Is there a feature allowing custom "Allow?" CLI inputs?

For example, if you deno run some program that reads from the file system, you're prompted Deno requests read access to... Allow? and you specify whether or not you want Deno to proceed. Is there any built-in or native feature that would let me cause the same kind of CLI "Allow?" prompt to appear with a custom message?

"deno compile --no-terminal" is not working

I'm trying to compile a very simple file named main.ts
await Deno.writeTextFile('test.txt', 'Hello World');
await Deno.writeTextFile('test.txt', 'Hello World');
...

Using fresh inside an existing deno folder

I have an existing deno project with deno.jsonc at the root and would like to add a web app as a subfolder. When I do this, vscode picks up the settings from the root deno.jsonc (instead of the one generated by fresh cli), so I see a lot of messages like this: “Relative import path "$std/dotenv/load.ts" not prefixed with / or ./ or ../ and not in import map from” What’s the recommended way to do this, i.e. to have multiple deno project inside the same root folder?...

Remove Dependencies from `deno.lock` file

Hello, Somewhere in the code, I did import postgres from npm:postgres. This import is the written to deno.lock as dependencies. Now I don't use that library anymore. How do I remove this dependency from deno.lock file?...

Good scripts/tools to automate conversion of Node.js based projects to Deno?

I'm wondering if there are commendations for tools like this? (I found something like this, but it seems to be kind of unmaintained: https://deno.land/x/nodedeno@v0.2.12)...

VS Code Extension API development with Deno as a runtime?

I'm dipping my toes into VS Code extension development. I only have Deno on my machine (for sanity), so the default template created by yo doesn't work out of the box. But I'd like to use it as a template to get going, and I'm wondering if I can have some help as I walk through this? ...

Importing submodules

Hi, I am working for the first time with deno in my supabase edge functions. I am trying to import a submodule in my import_map.json file. Currently, I have this. ``` { "imports": { "@microsoft/microsoft-graph-client": "npm:@microsoft/microsoft-graph-client@^3.0.7",...

Variable references causing lint errors across cells in Deno+Jupyter

If you define a variable in one cell and then try to reference it in another cell, you get a "Cannot find name" error. If you run the code, it works, but the lint error is really annoying....

VSCode starting Deno even if enabled=falseI

I use VSCode in a large project (with several JS packages, none of which use Deno), and after installing the Deno extension, the typescript extension fails to start (crashes 5 times and then gives up). My understanding is that by default, Deno isn't supposed to start, for this very reason, but it still is? I do not have a deno.json file anwyhere, and I've even tried setting deno.enable to false in .vscode/settings.json. Any idea what might be going on?...

Unable to build crate with deno_runtime 0.139.0 or 0.140.0, due to version numbering in deno_ast

The two most recently released versions of the deno_runtime crate cannot build at all, due to its build dependency deno_ast ^1.0.1. The latest version of deno_ast is 0.32.1, but cargo reads that as a lower version number, and therefore refuses to use it. The exact version 1.0.1 of deno_ast was yanked from crates.io, so it can't be used for building....

walk() include only last directory...

Hey, I'm currently trying to write a replacer for file names, file content and folder names. My goal is to crawl over a certain directory and then replace a certain pattern in file names, file content and folder names. Currently I use the walk() function from the std library. My problem now is that walk() returns every single directory and not just the last one. In other words, walk() does not just give me:
file/to/directory
file/to/directory
...

How to link local NPM package with Deno

I have a package which has a couple of peer dependencies, which I want to link locally and patch. What is the way to do it? The structure of dist folder is .d.ts + .js files, which looks pretty normal to me, thank you in advance 🙇‍♂️...
No description

Subhosting API protection

Is there a way to setup custom auth via some header for example for all subhosting routes? I.e. Deno will throw an error is Authorization!=="foo"?

lvim tsx language server

after i clone fresh example in deno deploy, I get an error "Cannot find name 'React' " while opening routes/index.tsx with lunar vim how can i solve this?...
No description

How to debug tests in Deno on VSCODE

Hello everyone, I am trying to debug a unit test in Deno. I have tried using deno test --inspect-brk and I tried generating a launch.json with the deno extension for vscode. Here is my launch.json ```json { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387...
No description

Dynamically importing NPM modules errors

The following works fine in Node:
const parser = 'acorn';
const { parse } = await import(parser);
const parser = 'acorn';
const { parse } = await import(parser);
...

deno kv watch vs broadcast channel

For creating a chat app for example, which one should i use? What are the differences? Kv watch gets triggered even if no isolate is alive?...

If I use FFI with Deno Jupyter, will it not print the shared lib's stdout? (like Rust println!())

If I use FFI with Deno Jupyter, will it not print the shared lib's stdout? This is an example of how it looks normally vs in Jupyter No output in Jupyter, just finishes execution while normally it prints the training progress each epoch....
No description