Deno

D

Deno

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

Join

Fresh: `toggle` is not a function.

I can't seem to figure out why the function toggle is undefined. I'm passing it like other examples on the internet. button.tsx ```tsx interface Props { toggle: () => void;...

Upgrade to Deno 2.2 caused an outage

Today, we upgraded from 2.1.10 to 2.2.11 and this caused an outage. Although we have extensive observability, there is no indication of what could have been the cause of it. The only things we know is that: 1) We are certain this is related to the Deno version, as we have reverted this only 2) Whatever it was, this caused high memory pressure ...

Do exceptions escape for await blocks?

I have an issue that seems to be an exception escaping my async iterator, could anyone verify if this is indeed something that escapes the environment if I try to rethrow in for await block? ```ts try { await socket.waitForMessage("StreamBeginMessage");...

Mocking the FileSystem

Hello! I'd like to mock the filesystem for some BDD tests - in other words, create some fake files before a test and tear them down afterwards. I need these mocks to specifically affect require.resolve calls. Do you have an example of this I could crib from?...

How to stub and spy an deep nested object in deno? (Firestore)

Im desperate with deno testing how can I stub a firestore object in deno? ```...

Web Cache API not available in Deno Binaries?

It seems like the Web Cache API isn't available in deno binaries created through deno compile. Is there any config that I need to change to enable this, or is this Web API just not available in Deno binaries? I see that the Web Storage API isn't available in Deno binaries, but I was wondering if the Web Cache API not working in Deno binaries is also intended. The specific error I'm seeing when I use try to use the the Web Cache API (in this case, caches.open("foo")) is TypeError: CacheStorage is not available in this context. I would appreciate any workarounds/solutions here, I need to be running my application through a binary generated through deno compile....

collab

anyone down for a collaboration for an project/brand someone who can build a artunning website, yeah...

Using express

Hi, I'm trying to use express with deno in https://github.com/the-benchmarker/web-frameworks/blob/master/javascript/express-deno/app.ts wuth the follwing command deno serve --parallel --port 3000 --allow-net --allow-read --allow-env app.ts. Is this somethinn doable ? Regards,...

@google-cloud/tasks not working

I'm trying to use the Cloud Tasks emulator from a Deno script using the @google-cloud/tasks npm package. I run the following code with deno run -A <path>, but I always get a timeout error like this: ``` Operation failed: Error: Total timeout of API google.cloud.tasks.v2.CloudTasks exceeded 20000 milliseconds before any response was received....

Deno Monorepo with nested applications and packages

I'm trying to move a node monorepo from NPM to Deno. It's got a set of applications in a directory called services, and set of libraries used by said services in packages. These are all independent, and are registered to the apps workspace (@example) for now. eg: if a service myapp registered as @example/myapp wanted packages/utils, it'd import @example/utils and it'd find it within packages. I'm trying to do the same in NPM but it seems like everything has to be flat, at the root. Am I not able to register workspaces that are deeper than the root directory? I've got /packages/foo/deno.json and packages/foo/mod.ts with a funciton exported. the deno.js has the following contents:...

Deno Fresh deployment failing in Github Actions

After adding Apache Echarts to my Deno Fresh website, my Github Actions now fail with a strange error: https://paste.jlcarveth.dev/paste/e04b7a13-39a8-461c-a7b1-bde1f241939b Error: R] Directory not empty (os error 39): rename '/tmp/1add3e3f311485e6' -> '/home/runner/work/eastsite/eastsite/.cache/deno/deno_esbuild/zrender@5.6.1/node_modules/zrender' [plugin deno-loader] ...

Help with File Uploads in Oak v17.1.4

Hi, I’m currently working on a project and I’m trying to upload images to my backend using Deno and Oak. However, I'm encountering an issue where I get the following message: "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:3000/upload. (Reason: CORS header ā€˜Access-Control-Allow-Origin’ is missing). Status code: 500." I’m confident that this isn’t a CORS issue because I’ve previously managed to send data to my backend without issues. When checking the backend, I get the following error message:" TypeError - ctx.request.body is not a function "...

upload files

I am working on a web development project, and in this project, I have a constraint that says I cannot use any frameworks. However, for my site, I need to upload images. For example, in my case, the user should be able to send images to my backend so that I can use them later on my site. How can I do this with Deno? If you could tell me how to do it and provide a small preview example, that would be great, please.

502: Bad Gateway (ISOLATE_INTERNAL_FAILURE) for long requests

I deployed a simple proxy on Deno, which just forwards my requests to TARGET_URL. When TARGET_URL responds quickly everything is OK, but when it takes 1-2 minutes to respond, I get an error: ``` 502: Bad Gateway (ISOLATE_INTERNAL_FAILURE) ...

Unable to compile the small file

I have create small "hello-world.ts" file, And I'm trying to compile it. It is failing to compile with following error. Check file:///Users/harshrastogi/Developer/hono/test.ts Compile file:///Users/harshrastogi/Developer/hono/test.ts to test ...

LTS 2.1.12 Deno generates `deno.lock` with version 5.

šŸ‘‹ Please help me fixing situation with broken deno.lock file. 1. I have installed Deno via shell script from docs. 2. Then initiated a Deno project, then added Fresh, etc. 3. During Deno Deploy I found out that version: 5 in lock files causes the problem. ...

Can't get inlay-hints working in helix and deno-lsp

Everything is working but the inlay-hints, any help?

OpenTelemetry Setup with Axiom.co

all the docs and demo videos by deno assumes that the endpoint is not authenticated. can someone help me to configure this with Axiom.co endoints I tried with these variables within env but this didn't work ```...

Cannot read `include`d folder in compiled file

Hello, I am trying to compile an application and read a folder that I include with it. I am running into a problem with the output. I don't know how to read a directory inside the binary that I have included. I ran this command deno compile --include config to include the folder config in the binary, but I don't know how to read it and where to find it. This is my folder structure: ```...

Vitest borked when inside Deno workspace

Not sure if this is just a misconfiguration or a bug somewhere, so I figure I might as well shoot my shot here. I installed SvelteKit with Vitest, Playwright and Deno as package manager. I had to change some generated npm commands to deno, but otherwise this configuration seems to work great. I then tried to integrate this setup into a Deno workspace, but that didn't work out so great......