Deno

D

Deno

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

Join

Failing to create a new NextJS Project

Hey, I am following the exact guide to create a nextjs app. When I start the app after full installation and not changing anything I get a hydration error. According to the internet this happened even 10 months ago I wanted to ask you if you can first replicate the issue and if so how to fix it? ...
No description

@discordjs/rest request gets AbortError in Deno CLI

I'm building a Discord bot using @discordjs/rest inside a Deno project (via npm module). When I try to start the bot, the request to Discord API fails with this error: AbortError: The signal has been aborted...
No description

Issues with ANSI control codes on compiled EXE

After updating Deno from a 2.2.x series update (not sure exactly which), I've got what seems to be a regression with deno compile. I'm using the yoctocolors and inquirer npm packages for a basic CLI tool, both of which have worked perfectly up to this point. After updating, the output from deno run seems normal (see attached). However, when the program is compiled, it now seems like the ANSI escape codes are being directly written out to the screen....
No description

Mocking EventSource

I'm writing tests for functionality that depends on EventSource and I'd like to mock EventSource entirely, but can't quite figure out how to get it to work. I've been referencing https://docs.deno.com/examples/mocking_tutorial/#stubbing and from what I can tell, stubs are for only replacing a method, not an entire class. Before I resort to wrapping it with another class that I can mock, does anyone have any ideas around this?

No object comparison linter rule in Deno.

How to enable a lint rule in Deno that shows warning when comparing objects?

ISOLATE_INTERNAL_FAILURE - on basic API middleware

tldr; works perfectly locally error when deploying to deno deploy very confusing as its a generic error - please help - code linked...

Recommended way to embed Deno with all its features

I'm currently building a build to which allows scripting via TypeScript/JavaScript. So far this is what I've tried and why I haven't been able to go through with it: - Using deno_core crate: too bare bones, you need a lot of configuration to get some basic functionality such standard node extensions, importing via node_modules etc - Using deno_runtime crate: better than deno_core but still missing import functionality via node_modules, also encountering errors which I have no idea where/how to fix ```txt...

Recommended way of installing deno 'virtually' (not globally)

Hey guys, following some tutorials to get started with Deno! All of them install deno globally... isn't there a way to keep a deno install 'local' per project? Couldn't find the answer yet, any help appreciated.

Nuxt & Deno (maybe off topic)

Hey guys! I’ve built a VueJS / Quasar app and keen to migrate to Deno/Nuxt. Reading Nuxt docs and copy paste their starter command fails all the way to version 4 which is close to release....

How to change views between 2 running tasks

I have 2 vite clients running at the same time, and i wish to change the visible logs that i see in the terminal (similar to how turbo does it), is there any way to do this? im running them like so: ```json...

WebSockets on Deno Deploy

Hi all, I've been looking into Deno Deploy for a creative web development class. We used Glitch in the past but with that platform now sunsetting, we're looking for a new home for students to learn and host their projects. Deno Deploy has jumped out as a great alternative with a very easy interface, a free tier that doesn't require a credit card, rich support, and very importantly: websockets support! I did some testing, both raw/native websockets and socket.io seem to work just fine. Only, we had some problems with clients getting sent a different state of our server running on Deploy. Client to server communication seemed flawless, however server to client thus acted a bit weirdly. I ended up switching things out for Deno KV.watch, but I'd still like some help on how I can best look into the websocket issues I was having....

How to get the path to the file from a deno_core op2?

I want to implement a subset of fs in op2, but I want it to be relative to the dir the file is in. I can't find anything on OpState or HandleScope for that though. And right now, import.meta.path is undefined, not sure how to fix that either...

allow read and still asks for permission

~/other/games$ /home/sac/other/programs/deno run --allow-read=~/other/games/magic-decks ./magic-decks/magic-sac/main.js Card Name ? ❌ Denied read access to "./magic-decks"....

Can't verify my Dynadot domain with Deno Deploy

I can't add a CNAME record because then it complains that a domain cannot have both A records and CNAME records at the same time (see image). And I'm not sure where in the form should I put the _acme-challenge string...
No description

`nuxt build` Could not resolve import "@mswjs/interceptors/ClientRequest"

I am failing on the last step using denoland/deployctl on app build, see error below ``` 10s Run denoland/deployctl@v1 with:...

Workers: Property 'onmessage' dos not exist

Im learning how to create worker threads but deno-ts says: Property 'onmessage' does not exist on type 'Window & typeof globalThis'. Code ```ts...

Deno compile inflates output size in monorepo — includes unused dependencies from other packages

I'm using a monorepo setup with multiple Deno projects as members (e.g., frontend/, backend/, shared/). When I compile a single project (e.g., backend/) using deno compile, the output binary size is significantly larger compared to when the project was standalone. Specifically: In a standalone setup, the compiled binary is ~70 MB....

why does deno compile read my other directories ?

If i run this on an empty directory with nothing but a main.ts, deno compile main.ts It tries to walk up the file tree and find other folders with node_modules/package.json ( not sure what its looking for ) And compilation never ends. ...

Embed `*/` in doc comment?

Per chance does deno doc have a solution for embedding */ inside a doc comment? There's no conclusion on the same issue in TSDoc, but one suggestion is to use a zero-width space in between the * and / character. This works well, but it's cumbersome and linters will complain about it.
No description