Deno

D

Deno

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

Join

Deno showing node globalThis error

Deno is showing this error:
error: Uncaught ReferenceError: __DENO_NODE_GLOBAL_THIS_0_43_0__ is not defined
at file:///home/ren/coding/frontend/packit/node_modules/@reejs/imports/env.js:1:18
error: Uncaught ReferenceError: __DENO_NODE_GLOBAL_THIS_0_43_0__ is not defined
at file:///home/ren/coding/frontend/packit/node_modules/@reejs/imports/env.js:1:18
...

How to read Chunked request body?

Hello! Is it possible to read a chunked request body using for await? It seems to only read up to the point where the reader is empty and then stop. Since some chunks might only show up after some delay, I need it to read until 'zero-length chunk' is sent, meaning the chunked body is over.

Deno Fresh (Saaskit base) - Impossible to debug error

When I try to access my account by logging in, the web app becomes unusable and I get this error

Possible to deploy the chat example to deno deploy?

I would like to try running this demo on deno deploy: https://deno.com/manual@v1.34.0/examples/chat_app However, I have seen somewhere that deploy doesn't suport websockets. Is this currently the case? Is it possbile to run this with deploy? ...

`dnt` incompatible with `addEventListener`?

I am using the log/mod.ts module from deno_std and running dnt with no special configuration as far as I know, why doesn't this just work? Some Node.js shim missing? ```ts src/deps/deno.land/std@0.189.0/log/handlers.ts:153:5 - error TS2304: Cannot find name 'addEventListener'. ...

Saaskit 0.2.0 - URLPattern error

I followed the README.md but when running deno task start this error pops up (image) How can i fix this?...

Running `deno cache` fails often with internal server errors when importing

Example message ``` error: Import 'https://deno.land/std@0.175.0/path/_constants.ts' failed: 500 Internal Server Error May 29 10:30:08 AM #14 309.3 at https://deno.land/std@0.175.0/path/win32.ts:12:8 May 29 10:30:08 AM ------...

Allow-net not applying to npm: imports ?

Hi, Running the below does not ask me for a permission to access github.com. ``` import axios from "npm:axios"...

How many Web Platform tests should deno be passing?

I wanted to package Deno as RPMs but before I started that, I'm getting very different test results just building from source. Should deno be passing every Web Platform test when its built? CentOS 7 Python 3.11.3 cargo 1.69.0 (6e9a83356 2023-04-12) rustc 1.69.0 (84c898d65 2023-04-16) Deno 1.33.4 - from source...

Deno Deploy with Cloudflare Proxy

Is it possible to use Cloudflare proxy with Deno deploy website? Cloudflare provides countryCode in headers, and I get only ip address with Deno Deploy...

Deno event loop and gui application

Hi, I am trying to write custom gtk library in deno using gtk-rs and deno_runtime. I already have initial rendering of components but i am having trouble understanding how to setup event loop for gui application. Currently i am using tokio's new_current_thread and block_on on deno's execute_main_module but this way setTimeouts don't seem to be executed which I suspect is because there is no event loop. execute_main_module seems to already call run_event_loop but should i just call it in loop or is there a proper way to do it using tokio? and how does event_loop_middleware fit into all this?
The other slightly related question is how do i schedule updates from the button clicks if the click listener closure is setup in the #[op(v8)]? thanks for your help...

Simple type narrowing/type guard/assertion (?)

Is there really no simpler way of doing this without any and without external deps? ```ts export function isFooBarBaz( value: unknown,...

Import is "Not yet initialized?"

No idea what this means. First screenshot is error, second screenshot is problematic line, third screenshot is the thing being imported. I don't know why it's saying it "hasn't been initialized", never run into this problem before and not sure what it's even supposed to mean....

How are deno processes/isolates managed in Deploy?

Hi, I'm writing a multiplayer game in Deno and currently all of the game state is kept in module-scoped objects, there's no database or any other form of persistence, yet. It all works as expected when I'm developing locally, but sometimes when testing in Deno Deploy, it's as if there's multiple instances of the game running and which one I'm connecting to is random (using the same URL.) Does Deploy create multiple simultaneous isolates for the same deployment? Is the only solution to implement...

Cannot access web server from other network devices when compiled

Hello. Im kinda new to deno and i just compiled my first bigger project with deno, but when the task is running, i can access the website directly from my pc, but not from my phone, which is in the same network. This is my code: ``ts import {serve} from "https://deno.land/std@0.188.0/http/server.ts"; serve(handler, {port: Number(env.PORT), onListen: () => console.log(Listening on http://localhost:${env.PORT}`)});...

How to use chrome devtools / inspector with Deno?

Hello all! I'd like to profile my game server written in Deno to identify the hot spots. I see that https://github.com/denoland/deno/pull/4484 was closed, but having trouble pulling up info on how to use it....

Clear local KV store

How do I delete/clear the local database?

Deno.Command not working for application

Hello. Im trying to start an application using Deno.Command, but it for some reason doesnt work. The path itself functions normally even from powershell. ```ts // Get the application to start const application = body.application?.trim()?.replace(/\/g, "/");...

Uint8Array or Float32Array

Is there any significant difference between using a Float32Array and using a Uint8Array from the same buffer for FFI?

Can I create a Fresh project inside another Deno project?

I would like to create a dashboard for my application (a minecraft bot), and I would like to use fresh to do so. I want everything to be contained inside the app's directory, so could I create a fresh project inside my current project? and then start the HTTP server programmatically? Or is there a better solution for something like this?...