Deno

D

Deno

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

Join

proxy-agent not working on Deno Deploy

I'm trying to use a proxy for the node-fetch requests in a deno app. I chose proxy-agent npm package and its working great on my local. It reads HTTP_PROXY environment variable and uses that host as the proxy. But when I deploy my app in Deno Deploy, proxy is not working. I set the environment variable correctly but proxy-agent is just ignoring that?...

Extremely high CPU usage in Windows running on Intel Pentium processor

I have a simple app (about 300 lines of code, few deps). I compile it into a Windows executable. When I run this exec. on any newer processor (I tried AMD Ryzen 5 and Intel Core i7) it works fine and the CPU usage is never higher than 0.1%, but when I run it on an older Intel Pentium processor it shoots up to about 40% which is crazy. RAM usage doesn't change. Any ideas?

Impossible to use `"jsx": "preserve"` in deno.json...

Well it seems that I can't use jsx preserve in deno.json, when I try to run any tasks in deno.json, I get the following error:
error: Unsupported 'jsx' compiler option value 'preserve'. Supported: 'react-jsx', 'react-jsxdev', 'react'
at file:///home/carere/Projects/Ashiso/zentai/deno.json
error: Unsupported 'jsx' compiler option value 'preserve'. Supported: 'react-jsx', 'react-jsxdev', 'react'
at file:///home/carere/Projects/Ashiso/zentai/deno.json
...

integrating deno_web

Ok I seem to have poobrain today. Can't seem to get the deno_web extension working. The core version on that crate is outdated so I assume that's not how I'm meant to use it ... just trying to get access to atob/btoa and the other methods it provides from deno_core...

Can I use Workers in an executable ?

Everything is in the questions, on the doc site, it is mention that we can't use Workers when creating executable, but then on the page executable, it says that we need to use the --include option in order to add the worker code to the executable. So what is the state of the Workers inside an executable with Deno actually ?...

WalkSync dosnt get files

Im trying to read all files of a folder with WalkSync from the deno STD libary but it dosnt see the file thats in it and dosnt log anything ```ts for (const entry in walkSync(this.client.root + "\src\events")) { console.log(entry); }...
No description

deno behaving differently in local dev env and production docker builds

I'm currently trying to switch from using node+yarn 2 for my blogs static files to deno. however the tasks that work locally for me fail to run properly in my container buildenv. I've even tried to use the curl | sh installer but the same behaviour persists. npm packages have trouble resolving deps which does not happen in my local dev env. Am i missing something?

Front end dev needed for 6 months.

Hello. I am in need of a frontend developer. dm me pls....

Include platform and version in compiled binary filename

Right now when i run deno compile --output bin/myprogram, it works as expected. Is is possible to save the filename by the package.json (or is there anywhere else i should put the version?) in the output filename? (e.g bin/myprogram_2.0.0). thanks

How to handle a user abort by Deno.serve

Hello, I have a question and discovered this Discord channel now. The Deno website has an example at: https://deno.land/manual@v1.36.4/runtime/http_server_apis#inspecting-the-incoming-request There is the note below: Be aware that the req.text() call can fail if the user hangs up the connection before the body is fully received. Make sure to handle this case. However, I have not found a sample how to catch this case. Can Deno detect that the connection has been terminated?...

API hooks during restart for deno run --watch

Hello! I thought it would be super fun to further minimize repetitive tasks while manually testing a work-in-progress app during early and active development. So far, I love that the deno watcher can react to source file changes! One of my goals would be to automate mundane tasks in order to observe feedback faster as I: learn deno, prototype ideas, experiment with browser APIs / paradigms (e.g. saving state on document hide via session storage), etc. Specifically, I would love the ability to programmatically reload a specific Chrome tab (e.g. via puppeteer), anytime that I save code changes. So far (after about a couple days of wrestling with Bash scripting), I've got a crude working prototype for this use case....

deno compile -A npm:cowsay not working

Hello, I am trying deno compile -A npm:cowsay and then following that with ./cowsay Hello World! but the result is: ``` error: Failed caching npm package 'cowsay@1.5.0'. ...

compiling issue with import { WebSocketServer } from "npm:ws@^8.14.1"

Using this impot in a "deno run --unstable [etc...]" env works flawless / as intended but trying to compile it, all of a sudden i get
'"internal:///missing_dependency.d.ts"' has no exported member 'WebSocketServer'
'"internal:///missing_dependency.d.ts"' has no exported member 'WebSocketServer'

Is there any way to get Deno to not statically analyze import()?

I understand that statically analyzing and fetching dynamic import() calls is a good thing for performance, but it's making my usecase impossible - I want to import user code, which may crash, and to handle the error if it, say, throws an error on import. I can do this with browser import(). I can do it with Node. I can't do it with Deno: you basically can't use import statements like you'd expect to if you read the MDN page, which seems like a major move away from this being web-standardsy and...

Using Deno in Frontend.

Hey, I was wandering if it is possible to use Deno for Vanilla Frontend development. I dont want to use a Framework like Oak or Fresh, I just want to use Vanilla TypeScript instead of JavaScript in my Frontend. As an example I just want types/typechecking for developing, build my Frontend and then transpile the whole thing to a JS-Bundle that I can then load in the Frontend. Now I have 2 problems. First is how to transpile my TypeScript to a JS-Bundle (I can do that with the emit module), and the second is how can I get the DOM in TypeScript. I have found this in the manual but I am not really sure how to use it. Can someone explain to me how to setup the DOM for TypeScript development in the Frontend. And also whats about Deno.* APIs? How does the emit module handle this? Thanks! ~Mqx...

Excluding certain directories when using "walk"

Hello, I'm writing a script that should crawl through a directory and search for a given text inside of these files. I'm having trouble understanding the documentation about walk options, specifically the skip option. It says: ``` skip: RegExp[] = undefined...

Syntax Error: Unexpected token 'export'

Hello, We are using Supabase Deno Edge Functions and are getting this error while trying to import a file into an edge function code: Uncaught SyntaxError: Unexpected token 'export' at file:///home/deno/modules/c675a10248170410cad4e4a996152aad5ad7f2a817728186567122b6394d9419:185:1 InvalidWorkerCreation: worker boot error...

Deno Deploy Questions

Hey there. We are using Supabase to run edge functions, which in turn built their feature on top of Deno Deploy. I'd like to know more about how Deno Deploy works. Our main inquiry are on topics such as how fast can these functions scale, and how do they manage request load balancing and load, where are these edges, what caching (if any) mechanisms are used, do they become "cold" after some time, how "ephemeral" are these functions in case some troubleshooting or reboot is required, etc. This comes since we've noticed some latency issues sometimes when we use our app and want to understand the root cause but searching on the guides we have no notion of how exactly are these edge functions being deployed and run and their surrounding environment. Any more in-depth info would help us greatly ....

Bunle OAK static assets to the compiled binary

Hi, I am currently switching from NodeJS to Deno, and so far so good! One of the reasons for this switch is how easily i can compile everyting up in one executable, which is important for my use case. However, I'm not familiar with OAK and how it integrates, as i come from Express. I have the current code, which runs fine on the CLI, but doesn't serve the assets once compiled: ```js...

The requested module does not provide an export named 'default'

I'm trying to export the following interface: ```import User from '../models/User.ts'; export default interface AuthRepository { signUp(uer: User): Promise<void>;...