Deno

D

Deno

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

Join

Deno <> Sentry | captureConsoleIntegration and captureException not working?

Seems like captureConsoleIntegration and captureException are not working in Deno? ``` import Env from '@/env.ts'; import * as Sentry from "@sentry/deno";...

Getting Deno and Nuxt to work well together

I've experimented with Nuxt 3 in the past and wanted to use it for a new project I'm working on, but at the same time, I wanted to try out using deno, and since Nuxt shows up on the list of supported frameworks, I decided to give it a try and use both of them together. The problem comes up when I try to add packages either from npm or jsr and nuxt never seems to find them. I tried creating a project with npm and moving the folder from the package into node_modules and it worked on the deno version, so I'm guessing it has something to do with how each one handles adding imports? I was trying it with @std/fmt Is there any way to fix it? Should I just use npm until nuxt adds better support for deno? Or is there any other framework similar to nuxt where I can use vue and where I can also use deno?...

I can't seem to get the recursive flag to run

I'm using a workspace setup. This is my root deno.json: ```json { "workspace": [ "modules/thought"...

How install from private registry?

Im trying to install a package from the github npm registry but it doesn’t work. I added the .npmrc file at the repo and user level

Vite [ERR_NOT_IMPLEMENTED]: Not implemented: http2.createSecureServer

Hi there, Im trying to run vite with https, however i always get the following error: [ERR_NOT_IMPLEMENTED]: Not implemented: http2.createSecureServer Does someone know how i can solve this?...

How do I make Deno run code when it is closed out on Windows

According to the documentation there is Deno.addSignalListener but it only handles on Windows when you use CTRL+C or CTRL+BREAK, how do I make it handle all possible closes like Deno.exit or closing it from the task bar?

running cypress with deno

someone have some case that, cypress work? I'm with problem with the cypress.config.js, because I can't import the modules

Global install with “Failed resolving binary export”

Trying to install a cli with deno but I’m running into two issues. The cli is “@cyclonedx/cdxgen”. 1. It fails to run the npm lifecycle scripts for SQLite no matter what I do (I tried setting “-A” to allow all permissions). 2. Ignoring number 1 it fails to run the cli because it “did not have a bin entry for ‘@cyclonedx/cdxgen’. Instead the “bin” is an object of key values, one of which being “cdxgen”. And Deno is aware of that as it lists them all as “possibilities”. However, I don’t know what to do with this information. Is there anyway I can tell deno to call the “cdxgen” binary, like npm would by default?...

Questions about files and what happens when other programs writes to them

I am a noob at programming. There is this video game I play named Team Fortress 2 and it has this option called condebug which makes it create a file with all of the contents of the in-game console, this file is updated in realtime. I'm going to use this in deno to detect in-game button presses and team-changes to control VLC Media Player. I want to make a script with Deno that reads this file out in realtime and decodes it to perform actions when it sees certain groups of text, I am wondering w...

npm package command cannot read deno.json dependencies

I got drizzle-kit installed globally, and I want to use deno @std/ulid package in my schemas, so I'm facing that I cannot import jsr packages when running in Deno a npm:package script. I'm not the only one, someone else is facing this issue too....
No description

Discord JS Invalid imports with Deno

Hi, I'm trying to create a discord bot using DiscordJS and Deno. When I import these modules I get errors in the IDE linter but when I run the code, it perfectly works. Following are the error messages shown by the IDE linter: ``` Module '"discord.js"' declares 'REST' locally, but it is exported as 'Collection'. deno-ts(2460)...
No description

deno include and cannot execute file when compiled

``ts async function run() { const o = await Deno.readFile(${import.meta.dirname}/win_clipboard.exe); console.log(o); // <-- Works and outputs the buffer const command = new Deno.Command(${import.meta.dirname}/win_clipboard.exe`, {...

Return Type Preact Forward

I make tsx component in fresh preact but have a error said it need a return type, what is the return type for a forwardref? 66 | const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref): JSX.Element => { | ^^^^^^^^ this symbol is missing an explicit type | = hint: add an explicit type annotation to the symbol...
No description

Properly Integrating JSDoc and Type Definitions for Deno and JS

Hi everyone! I’m working on a JavaScript codebase designed for both Deno and browsers. We’re adding documentation and types to publish it on JSR, but I’ve hit some roadblocks. Issue 1: JSDoc Using JSDoc for @param and @returns doesn’t work with deno doc or JSR—they ignore the types, likely because they rely on .d.ts files for type information. This seems limiting for *.js files but might be a technical constraint....

Import errors when importing into Jupyter

I'm seeing some weird behaviour when I try to import a module into Jupyter. A simple reproduction is: ``` import { unmarshall } from "npm:@aws-sdk/util-dynamodb@3.699.0"; import { DynamoDB } from "npm:@aws-sdk/client-dynamodb@3.431.0";...

GitHub imports from package.json in Deno

My workmate Ash has put a custom version of a package that is pointing directly to GitHub like this (canvg library): ``` "dependencies": { "@nanostores/persistent": "^0.9.0",...

How to reveal a long inferred type in order to publish to jsr

I've published a package to jsr (@schoolai/ts-prompt) and everything went well. Now, I'm improving the package and I have a function whose type is quite complex. Typescript is inferring its type correctly. However, when I go to publish to JSR, I get the "this function is missing an explicit return type" error/warning. Normally, I would just hover over the function in my editor (Zed, in this case) and it would oblige and show me the full inferred type--I'd then copy paste it into the code and call it a day. However, now that I have a very large/complex type, the editor elides some of the type information:...

deno compile error

When I try and run deno compile, I get the following error ```powershell $ deno compile day2.js
Check file:///C:/Users/cambe/JSprojects/AdventOfCode2023/day2.js Compile file:///C:/Users/cambe/JSprojects/AdventOfCode2023/day2.js to day2.exe error: Writing deno compile executable to temporary file 'day2.exe.tmp-b5a4393eacce0cd4'...

Replacing `fs.createWriteStream()` with Deno equivalent

Hi, I am trying to download files from S3 to disk and it works if I use fs.createWriteStream() as follows: ``` import * as fs from "node:fs"; import { S3 } from "npm:@aws-sdk/client-s3@3.701.0";...

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?