Deno

D

Deno

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

Join

Without using a framework, how do I compile natively supported TS in Deno into static JS?

If I am not mistaken, this used to be possible with the built in bundler which is now gone. How do we go from dev-time TS to prod-time JS without a framework or custom transpiler in the middle? Basically, help me get from deno init to deno "prod" - how to turn those main.ts files into runnable js?

Deno + oak crashes and i dont know what makes it crash

I get the following error, running deno 2.1.1: `error: Uncaught (in promise) TypeError: Cannot read headers: request closed return this.#request.headers; ^ at Object.get headerList (ext:deno_fetch/23_request.js:125:17)...

Loop Detected in Deno Deploy

Hi there! I recently tried to deploy my WIP webpage until this point i have only hosted it locally, there everything has worked well so far! However now i get a error when fetching a API route when I use the deno.dev deployed page!
No description

SvelteKit, Deno 2 and https imports

Hello, I'm trying to use Deno 2 and SvelteKit together. When I run deno task dev vite launches the website however when I try to load a webpage I get an error about one of my imports. Here is the import in my database manager file (db.ts): import { Client } from "https://deno.land/x/postgres@v0.19.3/mod.ts"; Here is the error: ```js...

Import declarations may only appear at top level of a module

Hello fellow dino's I'm currently trying to tip my toes into ML and decided to try out tensorflow-js. But it seems I can't get the depdency to import correctly. at first I just used a script tag that imported the module via cdn, which worked. and then as I wanted to avoid using cdn's I decided to add the dependency to my project and use it that way. But apparently I'm receiving this error: ```...

console.log styling

Hey, so i was trying to setup an esbuild file, and i noticed a couple things. The first thing i noticed was that, if i dont have all the permissions allowed when i run the ts file, my console.logs looked different. (see image 1) If i had all the permissions granted, by default it didnt look as nice (see image 2) Then i was trying to figure out why this was, and i ended up finding out, that if i didnt use the esbuild deno plugins, it would look all pretty and neat again. (see image 3) ...
No description

Can I fmt a string with Deno.<...>(...) ?

I'm wondering if fmt and lint can be called from the Deno module within scripts. thank you! Deno 2 is awesome!...

cors header issue

Hey, Im building a web project and now I'm facing a problem with cookies and sessions. When I try to provide to the user session credentials through my backend, I'm getting constantly "missing cors header 'Access-Control-Allow-Origin' " through the console output of the browser I tried many solutions provided through stack overflow but none is working for me...

`Module not found file:///src/main.ts` when trying to deploy

I try to deploy, but it fails looking for src/main.ts when I haven't even configured that ``` tale-tapestry on ī‚  main via šŸ¦• v2.1.1 via  v20.18.0 took 4s āÆ deployctl deploy --project=dry-squirrel-76 --include=dist ℹ Using config file '/home/maple/dev/tale-tapestry/deno.json'...

Error in Accessing Import that is working fine in node.js.

In react, What I'm doing is import { experimental_extendTheme as materialExtendTheme, Experimental_CssVarsProvider as MaterialCssVarsProvider,...

cannot publish package to jsr but it uses a shared file

So this is my setup ``` workspace/ packages/...

Error With Deno Command Installing JSR Packages

``` const installProcess = new Deno.Command("deno", { args: ["install", "jsr:@blitz-bots/builder jsr:@blitz-bots/config npm:discord.js"], stdout: "piped", stderr: "piped", });...

Build tool generate TypeScript for JSR

hi, I'm looking at publishing my NPM packages to JSR but I'm not sure what the best approach would be for my use case. For my NPM build setup, I use Rollup and some some transforms. One of these transforms is for turning TypeScript into JavaScript but I have others that I use too. JSR would prefer that you upload TypeScript for better auto generated docs so my hope was that I would be able to just take my current build setup but remove the TypeScript-to-JavaScript transform but I don't think I'm able to get Rollup to generate TypeScript. does anyone have any suggestion? if turns out Rollup can generate TypeScript that'd be great. Otherwise if there's another build tool that has the Rollup features I need, I'd be interested in learning about that. Other otherwise, if my best option is to just upload pairs of .js and .d.ts files to JSR like I do to NPM, please let me know....

Restoring from backup on Deno Deploy

When something goes bad to the data on Deno Deploy, i want to be able to quickly restore it from a backup. Is there currently an easy way to do that? Let's say i have a backup stored in S3 and i need to apply it back on Deno Deploy. This doc (https://docs.deno.com/deploy/kv/manual/backup/#using-backups) says:
S3 backups can be used with the denokv tool...

'dayjs' has no exported member named type Dayjs.

When I try to use the dayjs types I get the following error: 'dayjs' has no exported member named Dayjs. Did you mean isDayjs? Import code: import dayjs, { Dayjs } from 'dayjs'; Import mapping in deno.json: "dayjs": "https://cdn.skypack.dev/dayjs@^1.11.3" ...

Duplicate package versions

I'm getting this TS error: ``` Type 'OAuthConfig<any>' is not assignable to type 'AuthProviderConfig'. Type 'OIDCConfig<any>' is not assignable to type 'AuthProviderConfig'. Type 'OIDCConfig<any>' is not assignable to type 'OIDCConfig<any> & InternalProviderOptions'....

Deno.cron not respecting time zones

Hi, I have a cron job running using Deno#cron that is set to run at 0300 every day. This is a small program that runs on a linux/ubuntu VPS, however the same behaviour occurs on Windows 11. Latest version of Deno and Ubuntu 24.04. The timezone of the VPS is correctly set to NZDT and running date returns the correct time in the correct time zone. Printing Intl.DateTimeFormat().resolvedOptions().timeZone within the program also correctly prints the time zone (Pacific/Auckland). ...

No-terminal Seems to Not Work

Using --no-terminal seems to not work as the program will appear to not run at all, even if it is supposed to attempt to write to a file. Nothing will happen, files won't be written to, cant find anything on it.

VIM - ALE - import-prefix-missing: Relative import path

on vim with ALE config for Deno. got this error with commando "deno task dev" or "deno lint" do not have erro. vimrc...

Possible to ignore optionalDependencies?

npm:cbor-x has cbor-extract as an optional dependency, is it possible to install this package in Deno, without it trying to pull cbor-extract? I do not need it, and i causes warnings and errors.