Deno

D

Deno

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

Join

TypeError: str.split is not a function

Hey Gang. Im following along this tutorial: https://deno.com/blog/build-a-blog-with-fresh But I am running into some major issues. In the last step it tells me to use gfm (https://deno.land/x/gfm/mod.ts) to get the rendering markdown functioning. Like this: ...

Can't sign up/sign in to Deno Deploy

I'm tired of this error. Does anybody know the reason or at least how to solve it?
No description

CSP Middleware for OAK?

Just wondering what the best module is for this? I noticed SNELM but that hasn't been updated in about 3 years and the repo appears to be missing from GitHub. Are there any other options I should know about?...

External dependencies with npm specifier in combination with vite does not work.

Hi, I am new to Deno and want to build an app with deno, vite and react. Unfortunately the dependencies are not resolved correctly. It says: `The following dependencies are imported but could not be resolved: npm:react (imported by.....) npm:react-dom/client (imported by ...)...

Question about for loops

Why does the following code log numbers from 0 to 9 instead of 1 to 9? i is assigned as zero in the first expression, then it checks whether i is less than 10 and moves to the next expression which is i++, so it should increment the value of i to 1 instead and log it ```ts for (let i = 0; i < 10; i++) { console.log(i); }...

Dockerfile saaskit deployment

I created an entry in deno.json starting a script named db:init to initialize my KV DB with an user. When I add the RUN statement to initialize the DB before starting the app, it simply doesnt work. How can I make it work?
No description

Deno Types

What is the Deno.ServeHandler type? ```No overload matches this call. Overload 1 of 3, '(handler: ServeHandler): Server', gave the following error. Argument of type '(request: Request) => Promise<Response | undefined>' is not assignable to parameter of type 'ServeHandler'. Type 'Promise<Response | undefined>' is not assignable to type 'Response | Promise<Response>'....

I use Deno KV for my application, and I'm planning to use Deno Deploy. Can I allow deploy to use...

I use Deno KV for my application, and I'm planning to use Deno Deploy. Can I allow deploy to use KV database? How can I get access to KV experimental on Deploy?

bad resource id with node:crypto

```ts function test() { const key = randomBytes(32); const iv = randomBytes(16); const cipher = createCipheriv("aes-256-cbc", key, iv);...

Close a Deno.serve() connection?

Is it possible to close a Deno.serve() connection?

Relative import path "preact" not prefixed with / or ./ or ../ at https://deno.land/x/fresh@1.4.

Please help. ``` deno 1.36.1 (release, aarch64-apple-darwin) v8 11.6.189.12 typescript 5.1.6...

Problems with Deno KV

```ts import InputLoop from "https://deno.land/x/input@2.0.3/index.ts"; const kv = await Deno.openKv(); const input = new InputLoop();...

File differs only by case error

I'm getting a strange error from TypeScript. For some reason it thinks the case of my file name is different and it's causing problems with check and when running.
Says file differs only by case. How can I resolve this? I don't have access to Deno's ts config or cache or anything (that I'm aware of)...
No description

Possible to have multiple http servers listening to different ports in the same module?

I'm porting a service mesh platform we wrote for NodeJS over to Deno and it is based on the idea of hosting multiple servers in the same module.
The only examples I can find for Deno's http server uses a for loop to handle requests which seems like it's blocking. Is it possible to have different http server instances listening on different ports at the same time?...

How to have private state in embedded deno_core JsRuntime?

I need to either keep a reference in rust to an object I then delete globalThis.__context, but I can't do this since values I get from runtime.handle_scope() are Local and need a mutable reference to runtime, and I don't think I can make them global, since that also requires a mutable reference to runtime to get the isolate. Another option that works would be keeping the state in rust and accessing it through ops, but I'm not sure how to do that either. ```rust { let mut scope = runtime.handle_scope();...

Issues getting local environment running in VSCode and Visual Studio 2022

I'm a windows user trying to contribute on an github issue, but I've run into a few blockers. Using my IDE of choice, VSCode, I couldn't complete the build step. I ended up following the docs and trying Visual Studio 2022, which completed the build step with 0 friction. My main blocker with Visual Studio 2022 is that when I attempt to open the Deno repo folder, it freezes, then crashes. Broadly speaking, I'm wondering if anyone else has encountered this issue with Visual Studio 2022? I'd also be interested in hearing if any other windows users have been able to contribute with VSCode, as that would be preferential for me to work in. The error I'm getting in VSCode on running cargo build -vv is as follows: ...

Relative import path "ioredis" not prefixed with / or ./ or ../

// main.ts
import Redis from "ioredis";
// main.ts
import Redis from "ioredis";
```json...

Pixi.js breaks Deno

I'm trying to import Pixi in a Fresh island: ``` import { Sprite, Stage } from "npm:@pixi/react@7.1.0"; ...

Confused by deno vendor-related behaviors

I created a main.ts containing this code:
import * as thrift from "npm:thrift";
let connection = thrift.createConnection("localhost", 9160);
import * as thrift from "npm:thrift";
let connection = thrift.createConnection("localhost", 9160);
...

How to release node:zlib resources

I have some testcases which use the node:zlib polyfill and I'm having a bit of trouble getting the tests to pass. Here's a very basic example: ```ts import { createDeflate } from 'node:zlib'; Deno.test('deflate teardown', async () => { const deflate = createDeflate();...