Deno

D

Deno

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

Join

Deno + Vite + DenoKV

Hi, is it possible to use DenoKV in a Deno + Vite Project. Tried to set up Database but seems to be an error not finding Deno at all ... const kv = await Deno.openKv(); results in ReferenceError: Deno is not defined Made a database.ts file in my project src folder.....

can't access jsr packages in deno v1.3.6

hi, we're running an older version of deno which isn't aware of jsr and doesn't have an "add" option. can someone help us import a basic @std/io package to get started?

Inprove performance in lint to windows

Hello, I would like to inprove performance on deno check and in the lint of deno. I don't know exactly how to put my local mods of deno to run im my machine. Somebody could help me in this jorney and more specific in this first step? an exemple: https://github.com/deco-sites/storefront/...

Import built-in Node module from deno.json imports

How can we import built-in Node modules by adding imorts to deno.json? We are getting below error when we do it ``` error: Relative import path "url" not prefixed with / or ./ or ../...

Unstable byonm breaks Deno Fresh

When I try to run the boilerplate Deno Fresh project with the byonm unstable flag, it seems to start but does not turn interactive. I know unstable flags are there to protect us from breaking changes, but maybe someone already solved this or knows how to solve it. To get it to where I am, I - created a new project with tailwindcss. - set the byonm unstable flag in deno.json...

How to prevent dynamic code from installing remote packages.

I want to allow user submitted code to be run but at the same time i do not want them to install remote dependencies (i.e. dynamic import from npm or jsr). My understanding is if i run deno run --no-remote --cached-only would do the job. I have ran deno cache with vendor: true in deno.json file. But, when i run with --no-remote flag, i can't use any of the standard libs in my deno code. I am getting the follwoing error: ``` deno run --cached-only --no-remote main.ts error: JSR package manifest for '@std/crypto' failed to load. A remote specifier was requested: "https://jsr.io/@std/crypto/meta.json", but --no-remote is specified. at file:///home/xxxxxx/deno/test/main.ts:3:24...

How to reuse SSL session

In Ruby, you can create an openssl socket, reuse a session from another ssl socket, and then connect like this: ``` data_ssl_socket = OpenSSL::SSL::SSLSocket.new(data_socket, context) # data_ssl_socket.sync_close = true data_ssl_socket.session = ssl_socket.session...

AsyncLocalStorage without `node:async_hooks`

I'm trying to remove dependencies on node: in a Deno project. I just came across https://github.com/nodejs/node/pull/48528 and I'm wondering if it could unlock AsyncLocalStorage without a dependency on node:async_hooks for Deno. I am having a bit of a hard time following the various PRs/Github issues, but I also found some fairly recent work that seems related: https://github.com/denoland/deno/pull/25140 https://github.com/denoland/deno/pull/24402...

Child process doesn't exit on .kill()

I have a Fastify Node app that I'm running from Deno as a child process. I can spawn the child process just fine, and see that it's all running as expected. When I call .kill() and await the .status, I can see it exits with a status code of 1. If the script then waits (even a full minute) and spawns a new child process of the same Node app, I get an EADDRINUSE error. If, instead, I exit the Deno app and start it again (in well under a minute), the first child process spawns fine and the desired port is available. It looks like, despite returning an exit code, the child process isn't actually terminated while the Deno app keeps running. I can even see the Node process still in my task manager after it's supposedly been terminated. Once I exit the Deno process, the Node processes disappear immediately. The exit code of 1 probably means that something's wrong, but nothing's coming in over stdout or stderr. FWIW, I get the same when I try to run a Vite dev server instead of a Fastify app, with the same result. Anyone know what I'm doing wrong?...

`deno vendor` + `/// <reference types=...>` ?

In Deno 1.46.3, it seems that deno vendor doesn't like to see <reference types=''> entries in source code. Concretely, I can't seem to call deno vendor in any project that eventually sees https://deno.land/std@0.224.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.mjs?source=#L5, since that causes the following error: ``` error: Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported. Specifier: https://deno.land/std@0.224.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.d.mts...

`deno vendor`: help with import_map.json changes from deno.land to jsr?

Hi - I'm hoping to get some guidance of best practices of migrating a (n admittedly complicated) import_map.json file from using https://deno.land/std@0.224.0 to jsr Our import map at Quarto currently contains entries like this: ```...

Allowed to use an external proxy service and let the Deno transform the JSON data?

I want to use Deno to transform some JSON data serverless. However I'm pulling the data from the proxy Brightdata using the proxy_agent (https://deno.land/x/proxy_agent@v5.1.8). So I don't use Deno as scraper/ proxy itself, but just to transform and analyse the resulting JSON data. Is this a allowed use-case? On the Deno limitations website I see: "...

Decorators are not valid here.deno-ts(1206)

I just updated deno after like a year maybe and now I am seeing this. Do I need to turn on some config option or something to use decorators? Thanks...

npm executable script error: 'node:process' does not provide an export named 'execPath'

Hi there! I'm testing Deno's ability to directly execute npm packages with bin entries ( https://docs.deno.com/runtime/reference/npm/ ). In particular, I'm testing it against likec4 ( https://www.npmjs.com/package/likec4 ). The LikeC4 CLI ( https://likec4.dev/tooling/cli/ ) offers commands to build, serve, export, etc. The ordinary way it's recommended for use is either via an npm local install or using npx. On paper, it seems like a command like deno run --allow-read --allow-write npm:likec4 export png -o ./ should work. However, it throws with the error message Uncaught SyntaxError: The requested module 'node:process' does not provide an export named 'execPath'. I've attempted to search through the deno documentation, Twitter, and the web for anything relevant. I see that Deno includes a process.execPath property, but I can't figure out how it could be used in the context of an executable script. I'd appreciate any help or insight anyone could offer. My use case isn't mission critical, it's just a personally relevant example I'm using to learn more about what Deno is capable of. If you would like to try reproducing the error, create a directory with a .c4 file in it (ex: ./example.c4). Within that file, you can paste in a sample LikeC4 definition, such as this one: https://playground.likec4.dev/w/bigbank/ . Finally, with your command line scoped to that directory, run the command I shared previously: deno run --allow-read --allow-write npm:likec4 export png -o ./...

Deno vscode not using import map when in a workspace context

Hi, I'm trying to use Deno workspaces in a mixed deno/node environment. I have a package with deno enabled, which uses an import map in the deno.json file (package specific). In my code I'm getting the error Relative import path "hono" not prefixed with / or ./ or ../. (Reported by deno(import-prefix-missing) When I enable deno for the entire project (deno.enable in vscode settings) the error goes away. When I enable only for specific paths this error appears. Running the file works fine. ...

KV multimap / unordered keys search

Hello, I want to do an unordered keys search on deno kv FoundationDB talk about multimap (https://apple.github.io/foundationdb/multimaps.html ). I don't find it for deno kv. ...
No description

ISOLATE_INTERNAL_FAILURE using KV

Hello! I've used Deno KV in the past, but just today whenever I try to deploy a new project, everytime I get: ``` Project linked to GitHub Downloaded file:///src/test.ts (1/1) Packaging complete...

Can't get Deno to support loading a .ts module

I'm attempting to setup deno_node in my project and while attempting to add deno_node and its dependencies, I get this error:
Failed to initialize a JsRuntime: Uncaught SyntaxError: Unexpected token '{'
at ext:deno_node/_http_outgoing.ts:12:13
Failed to initialize a JsRuntime: Uncaught SyntaxError: Unexpected token '{'
at ext:deno_node/_http_outgoing.ts:12:13
From the digging around I could do, its because I need to somehow transpile this code as Deno loads it with a ModuleLoader but I'm not sure how to do that. If there are any examples or guides for this that would be greatly appreciated...

Using SolidJS with Deno

Hey I am currently trying to set up a template for SolidJS development with Deno and I am unable to figure out how to set the deno.json configuration correctly. Especially the compilerOptions. Can someone please give me an example on how to setup the JSX stuff? I am always getting errors that my config is invalid. Thanks....

deno lint missing imports

Question regarding deno lint. Is there a rule to ensure that all packages have an import?