Deno

D

Deno

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

Join

Deno compatibility with local Node/NPM package

Hey everyone, I'm hoping to get some configuration advice for a tricky scenario involving Deno compatibility with a local package that targets the npm ecosystem. I’m using a framework called SST, which generates a sidecar package inside an .sst/ directory within my project. The .sst/ directory contains SST’s internal tooling, including its own package.json and node_modules. My Deno code needs to import types from this generated directory. The problem seems rooted in .sst/ targetting the npm ecosystem, but Deno treats .sst/ like any other source code in the project, e.g., expects import foo from 'npm:bar' instead of … from ‘bar’, or import { add } from ‘./calc.ts’ instead of … from ‘./calc’....

Is using something like @opentelemetry/instrumentation-pg possible with Deno

I love the built in Otel support in Deno. It makes it very easy to get up and running with a base level of telemetry. One of the big things I'm missing at this point is tracing of my DB queries. I have it out of the box in some of my other non-Deno projects. I know this type of thing has been painful in the past with weak NPM support and no built-in Otel support in Deno but it feels like we should be in a new world. Now with much better npm support and Otel out of the box it feels like it is within reach. Looking at how to configure this library it appears I would need to register the instrumentation which it kind of feels like I would expect to get that function from something built-in to Deno since it is the thing running my telemetry at this point. Has anyone had any luck with something like this?...

Compiling Deno from source: Could not run `gn`: Os { code: 2, kind: NotFound, message: "No such file

I'm currently trying to compile Deno from source on raspbian arm32 (since there's no prebuilt binaries for arm32) and I'm running into the following error: ``` The current directory is /home/z/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/v8-137.2.1 gn gen --root=/home/z/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/v8-137.2.1 /tmp/cargo-installoYPBs7/release/gn_out ...

Unable to access injected env variables like PGHOST from connected Postgres Database

edit: seems more appropriate to add it to #deploy™-ea After reading the documentation, my understanding is that there are environment variables from my connected database that are injected automatically. I'm attempting to run a migration command with drizzle during the build step (I've set a "Build command" in my app's configuration in the dashboard).. however it appears that these environment variables are undefined, looking at my failed builds....
No description

Deno Pointer FFI error, malloc(): invalid size (unsorted)

Some runitime im my software i have the error, some me help to fin the line with error? ``` libName = libName.toUpperCase();...

Open Telemetry debugging

I have the Deno Open Telemetry set up, it works fine with a in-house Tempo collector. I'm trying to setup the collector to another one that requires auth (via headers) but this is not working, I think it is the collector is refusing the request. I'm using OTEL_EXPORTER_OTLP_HEADERS="Authorization=<REDACTED>". Two questions: 1. How can I turn any kind of debugging on so I can see open telemetry requests errors? 2. Can I wrap the data, all traces, in a custom property?...

How to use Tensorflow in Deno?

I came here todo searching for some Tensorflow on Deno examples. But all examples seem to be broken and most of the questions about it do not have helping answers, So can I use Tensorflow in Deno, are ther examples, what are the limits? Or is there maybe a better approach to ML? ...

Upgrade Not Working

Someone launched a DDOS attack on me last night. I want to add Cloudflare (i can do this with dns) and make a pro payment to get my service back up (currently get code: QUOTA_EXCEEDED error), but I can't seem to do it. I try the card, it accepts it, but I get redirected back to the dashboard page from the payment page. Can you help me?

Issues with Type Stripping

Not entirely sure where to ask this question. I am getting issues with the Deno Adapter for Deno Deploy that it does not support Type Stripping. This means I cannot run the Clerk integration in an Astro project. Any ways around this? error: [ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING]: Stripping types is currently unsupported for files under node_modules, for "file:///Users/sebastian/workspace/github.com/bastianplsfix/astro-clerk-issue/node_modules/.deno/@deno+astro-adapter@0.3.1/node_modules/@deno/astro-adapter/src/__deno_imports.ts" Here is a mock repo....

Deno2 with fresh gets stuck on build

Just hangs on Assets written to: C:\Git\fresh_fresh I notice some empty chunks, how to I troubleshoot further?...

deno test output: tty ansi is not escaped

When im testing deno tty ansi codes (e.g. test if "\x1B[2F" is a string) they are not escaped when printing within terminal. + they are diff-colored so it's completely broken. This should be easy to fix. The test:...
No description

How do I bundle with deno (with javascript) instead of esbuild?

I have the following project structure: ``` backend/main.mts common/util.ts # imported by both frontend and backend frontend/frontend.mts # statically depends on e.g. threejs...

Arguments ignored in Deno Deploy EA

Trying to deploy to deno deploy and the arguments don't seem to work as expected. Am I specifying them incorrectly?
No description

Attempting to generate drizzle migrations yields 'Cannot find module' error (@std/path)

This was working when I last tried, possibly on deno 2.4.3 or 2.4.4. Current deno version is 2.4.5, running on linux. When attempting to generate drizzle migrations, I am met with the following error: ``` Task db:generate deno run -A --node-modules-dir npm:drizzle-kit generate...

Embed Deno into Rust App: How to call other method with poll_event_loop keep going

Hi, all, I'm trying embed deno_core into Rust Gateway. like openresty(lua) in NGINX but for Deno(javascript) After reading the docs, I need continuously call https://docs.rs/deno_core/latest/deno_core/struct.JsRuntime.html#method.run_event_loop to make deno event loop running. Sometime, after gateway received request headers, we need to call method on_recv_request_header in Deno script, but due to the call to run_event_loop, we already await blocked in there, I can't get JsRuntime back, So I need find a way to stop run_event_loop temporarily, get JsRuntime back , then call run_event_loop again Possible solution:...

Running node/npm scripts with Deno

I am trying to use Deno in place of npm for a particular project. I run deno install and it appears to install deps just fine from the package.json. The scripts in the package.json are a series of tsx scripts, like:...

Deno KV Type narrowing issue

```ts import { createDiscordOAuthConfig, createHelpers } from '@deno/kv-oauth' import { env } from '../../../env.ts' // Discord OAuth configuration for bot authorization...
No description

Deno deploy

How do I fix ?
No description

import aliases fail if I move them from tsconfig.json to deno.json (Astro project, VS code)

Hi, I'm trying to migrate an Astro project to Deno. The issue I'm currently facing is that when I move path aliases from tsconfig.json to deno.json everything stops being resolved. ...

Can I use deno KV in worker?

It looks work, but does not persist at all. See my sample code below. Q1. why "key1" is not listed in my worker? Q2. why "key2" always 1?...