Deno

D

Deno

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

Join

Dynamic import at compile time

I am trying to import files dynamically based on a glob pattern. These files are not imported correctly when I compile the application. It only works with a static string. Is there any way to make it work with the glob pattern? or is there a workaround? Or do I just have to import the files using static strings...

Problems with modules import

Hi, I'm coming from a nodejs background, I'm a fullstack webdev but I'm pretty new to Deno. Right now I'm trying to build a tokenizer for my app but I'm having an hard time understanding how the modules work in Deno, I think there is some authorization command that are needed to use modules as Deno is aiming security first. I'm coding on neovim. Here is a picture showing my problem. If anyone could help me with that, it would be really appreciated. Thank you and have a good day....
No description

Installing with script from website does not work directly

I know this isn't technically Deno CLI, but it's the closest related tag I could find. I used the install script from deno.com today: curl -fsSL https://deno.land/install.sh | sh It results in an error mkdir: /home/<username>: Operation not supported...

@std/expect `anyOf` equivalent?

I have a value that promises either a value or undefined. How would I test this?
No description

What makes a selector being clickable on browser, but not on runtime?

I'm trying to click the "What's on your mind" input on a Facebook user profile. I can do that in the browser:
const whatsOnYourMind = document.querySelector("#mount_0_0_Xr > div > div > div:nth-child(1) > div > div.x9f619.x1n2onr6.x1ja2u2z > div > div > div.x78zum5.xdt5ytf.x1t2pt76.x1n2onr6.x1ja2u2z.x10cihs4 > div.x78zum5.xdt5ytf.x1t2pt76 > div > div > div.x6s0dn4.x78zum5.xdt5ytf.x193iq5w > div.x9f619.x193iq5w.x1talbiv.x1sltb1f.x3fxtfs.x1swvt13.x1pi30zi.xw7yly9 > div > div.x9f619.x1n2onr6.x1ja2u2z.xeuugli.xs83m0k.xjl7jj.x1xmf6yo.x1emribx.x1e56ztr.x1i64zmx.x19h7ccj.xu9j1y6.x7ep2pv > div:nth-child(1) > div > div > div > div > div.x1cy8zhl.x78zum5.x1iyjqo2.xh8yej3 > div > div.x1ey2m1c.xds687c.x17qophe.xg01cxk.x47corl.x10l6tqk.x13vifvy.x1ebt8du.x19991ni.x1dhq9h.x1o1ewxj.x3x9cwd.x1e5q0jg.x13rtm0m")
whatsOnYourMind.click()
const whatsOnYourMind = document.querySelector("#mount_0_0_Xr > div > div > div:nth-child(1) > div > div.x9f619.x1n2onr6.x1ja2u2z > div > div > div.x78zum5.xdt5ytf.x1t2pt76.x1n2onr6.x1ja2u2z.x10cihs4 > div.x78zum5.xdt5ytf.x1t2pt76 > div > div > div.x6s0dn4.x78zum5.xdt5ytf.x193iq5w > div.x9f619.x193iq5w.x1talbiv.x1sltb1f.x3fxtfs.x1swvt13.x1pi30zi.xw7yly9 > div > div.x9f619.x1n2onr6.x1ja2u2z.xeuugli.xs83m0k.xjl7jj.x1xmf6yo.x1emribx.x1e56ztr.x1i64zmx.x19h7ccj.xu9j1y6.x7ep2pv > div:nth-child(1) > div > div > div > div > div.x1cy8zhl.x78zum5.x1iyjqo2.xh8yej3 > div > div.x1ey2m1c.xds687c.x17qophe.xg01cxk.x47corl.x10l6tqk.x13vifvy.x1ebt8du.x19991ni.x1dhq9h.x1o1ewxj.x3x9cwd.x1e5q0jg.x13rtm0m")
whatsOnYourMind.click()
...

Deno.serve with aws-lambda-adapter

I went through this tutorial on How to Deploy Deno to AWS Lambda https://docs.deno.com/runtime/tutorials/aws_lambda/ and it worked with the Hello World example provided. It uses aws-lambda-adapter to adapt HTTP servers to the AWS Lambda runtime...

deno task build vue application failure

Hello I am trying to setup a vue 3 application with vite using deno (mostly using the proper tutorial from the deno page itself). However, when I run deno task build, I get the following error: ❯ deno task build...

is there a command I can run to ensure that all jsr dependencies are cached?

For context: I always build and run inside docker containers but my vscode runs on the host so all my jsr dependencies get red squigglies saying that the jsr packages is not installed. I'm using deno workspaces with 8-9 apps in it... I dont' want to run each one on the host just to make sure jsr packages are cached... and running "deno install" in the workspace root doesn't seem to cache the jsr packages? Also, I wonder how people have their deno dev containers setup? Do you map the host deno ca...

Access default TypeScript compiler options

I'm writing a library that makes use of the TypeScript compiler API. However, I'm unsure of how to access the compiler options from Deno. I could read the compilerOptions field from deno.json, but I don't think that will fully solve this since I also need the defaults provided by Deno itself. Any ideas how I could achieve this? Or is this sort of thing not currently supported?...

Deno FileServer Tutorial Incorrect?

I had a look at the official fileserver tutorial (https://docs.deno.com/runtime/tutorials/file_server/) and saw the below ```ts try { const file = await Deno.open("." + filepath, { read: true });...

How to get promise fulfilled result use deno_core?

I want use jsRuntime to run js func, i use &mut worker.js_runtime.handle_scope() to get scope, so i can't use worker.run_event_loop(false).await.unwrap() when result is promise. I just learned rust not long ago, I don't know how to deal with this situation of multiple variable references. worker is deno_runtime::worker::MainWorker.
No description

Best way to render a scene with THREE JS and store it as image (backend only)

What is the best way to render a scene using THREE JS and deno completely back-end and store the image of scene on file system?

Building next with deno fails with error

``` node:process Module build failed: UnhandledSchemeError: Reading from "node:process" is not handled by plugins (Unhandled scheme). Webpack supports "data:" and "file:" URIs by default. You may need an additional plugin to handle "node:" URIs. at /Users/psbakre/Personal Projects/images/node_modules/.deno/next@15.0.2/node_modules/next/dist/compiled/webpack/bundle5.js:28:401783...

Is there an example with SomidJS AND Typescript with Deno ?

Hello, I write this message since I can't use SolidJS with Deno, all the example on the web are in JS... And not TS... I don't know how to load the proper JSX runtime on the deno.json... If anyone has a clue, I'll be happy to unlock myself with this issue......

Is it an expected behavior of deno when installing npm packages?

Is it an expected behavior of deno to exit early when irrelevant package for the current platform could not be found? It happened when running deno install npm:@webviewjs/webview deno exits with the following error
Add npm:@webviewjs/webview@0.1.2
error: npm package '@webviewjs/webview-freebsd-x64' does not exist.
Add npm:@webviewjs/webview@0.1.2
error: npm package '@webviewjs/webview-freebsd-x64' does not exist.
even though I'm currently not on freebsd. Both npm and bun (bun shows not found warnings for irrelevant packages) work just fine for comparison....

Deno.Command adding a weird newline on an argument

Howdy, I need help with Deno.Command adding a newline to an argument passed to the call. It's pretty weird as with the debugger I can clearly see that there is no added newline in the string that I use....
No description

I'm not getting any warnings for no-overlap in vscode

I have some code which is actually bad and should be caught by SAST ``` if (typeof progress?.completedAt === "string") { // we're done already return;...

Scaffolding project hangs

Hi! I'm new to Deno and was trying to scaffold a React project with Vite: deno run -A npm:create-vite@latest --template react-ts. However it seems to hang (or at least doesn't quit the setup) in the terminal. It does still create the directory. I just have to ctrl+C first. Is this the expected behaviour?...
No description

Why Does Firebase JS SDK work on Deno

I thought the SDK was client-side only, so I’m curious to understand how it’s able to function on a server-side environment like Deno. Thank you!