Deno

D

Deno

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

Join

tsParticles & Deno

Hi, I’m working on a personal project with Deno & Lume. I’m trying to use tsParticles with preact. It seems to be some misconfiguration, but I don’t understand what I’m missing....

Looking for a library to pretty print </br>, <a>, etc tags

As that title says, I'm looking for a library that can pretty print a string containing the mentioned tags, it should also be able to parse &amp; etc, Does such a library exist? Example: ``` Lorem ipsum dolor sit amet,</br> consectetur adipiscing elit.</br> <b>Aliquam</b> quis augue eu metus efficitur dapibus. Ut pharetra ullamcorper vestibulum...

Importing `puppeteer-cluster` from esm.sh causes `does not provide an export named 'default'` error

When importing https://esm.sh/puppeteer-cluster@0.23.0 I get the following error:
error: Uncaught SyntaxError: The requested module '/v130/y18n@5.0.8/denonext/y18n.mjs' does not provide an export named 'default'
at <anonymous> (https://esm.sh/v130/yargs@17.7.1/denonext/helpers.js:4:1997)
error: Uncaught SyntaxError: The requested module '/v130/y18n@5.0.8/denonext/y18n.mjs' does not provide an export named 'default'
at <anonymous> (https://esm.sh/v130/yargs@17.7.1/denonext/helpers.js:4:1997)
...

Deno linting not working

Hello everyone, I enabled deno for a subpath in my project (./supabase) but unfortunately I'm not getting any linting or autocomplete. If I type "console.log" for example, I get absolutely no linting, hovering over objects also shows nothing. This happens even if deno is enabled globally. Here is my config file: ```json {...

deno_python

I'm trying to use Python with Deno with https://deno.land/x/python@0.2.7 What should I do to enable import Python 3rd party module, should I create Python venv?...

Deno VS Code plugin too aggressive in auto-completion

I'm new to Deno and learning through some tutorials. I'm using VS Code and have the Deno plugin enabled. I find that the auto-completion to be very aggressive. It will often complete something even if I don't hit tab. For example, when I type
app.use(async (ctx,
app.use(async (ctx,
...

how to exit all async command in deno task?

consider this code ```json { "tasks": { "dev-server": "deno run --watch --allow-read --allow-net --allow-env dev.ts",...

node-pre-gyp install failing inside docker container

I'm building something that depends on a library with a native component (pulsar-client) and it doesn't work directly in deno because of #16164. I'm trying to use the workaround described in https://github.com/denoland/deno/issues/15611#issuecomment-1330469239 to manually run the dependency's install script. This works fine in macOS, but in a Docker build the command fails when afaict it's trying to untar what the NAPI glibc tarball. The failing command is ``` deno run --allow-all npm:@mapbox/node-pre-gyp@1.0.9 install --fallback-to-build...

Set a cookie in GET and retrieve in POST

been tryinig to do this for a couple hours now. Basically I want a way to return the user to the previous page upon successful login. Currently I'm trying to set a cookie of "last_page" in GET and then reading it in POST when the user clicks Login....

What are newUserProps()

I'm reading saaskit source, and I don't understand the point of newUserProps(). Why not just define isSubscribed in the createUser() function with all the other values as it is in the interface as well? We could just set it to false by default?

Run a detached child process in Deno

I'm looking at running a detached child process using Deno. Specifically I want run something like a script or a web server without needing the parent Deno command staying open. In node I can achieve it using spawn doing something like this. ```js...

deno info returns module not found

deno info https://raw.githubusercontent.com/Murcul/norm/v1.3.0/src/mod.ts
error: module could not be found
deno info https://raw.githubusercontent.com/Murcul/norm/v1.3.0/src/mod.ts
error: module could not be found
...

can't scrub video

```<div className={"flex flex-col text-primary w-full lg:w-1/2 justify-center"}> <video className="w-full" controls> <source src="intro-video.mp4" type="video/mp4" /> Your browser does not support the video tag. </video>...

Proper usage of `Deno.HttpClient`

Hi! I'm creating an application which allows the internal use of HTTP proxies for certain tasks. In that case, fetch() requests are given an instance of Deno.HttpClient per proxy, but for multiple fetch() calls, if they're supposed to use the same proxy, the same HttpClient instance is used. This is something I am curious about, should I create a new HttpClient for every executed fetch(), or is it fine to reuse the same HttpClients for multiple requests?...

What's a good way to write tests for a script which does a bunch filesystem wrangling?

As per the title - I have a script which, given a folder, does a bunch of moving and renaming. I'd like to test it, ideally without having to abstract the entire fs away. The last timer I had to do this under Node.js I think I used mock-fs, but that works directly with Node's fs API. What would be a good approach for doing this in Deno?

Syntax error when getting prop children Element but compiles

Is this error important? How can I fix it? Should I fix it?

Generate jUnit XML file from Deno Tests

Hey is it possible that the Deno Test suite generates a jUnit XML about the Test? So that I can display the results on GitLab/GitHub?

How to do callbacks with `deno_core`?

Hello! I've been inspired to write an application after reading this article: https://deno.com/blog/roll-your-own-javascript-runtime-pt3. Of course, I had to modify some of the code due to some version changes since the release of that blog post. Here's the problem! I'm using a cut-down version of deno (implementing my own ops) as a runtime for plugins, written with JS/TS to modify a VTT. In this architecture, you might want plugins to subscribe to events and to have Rust emit those events. However, I have no clue how I could do this, or even if I could do this. Furthermore, it's a common occurrence for an application like this to have one "system", which establishes some base functionality, and then "modules" which overwrite, edit, or delete parts of a system with their own code. For instance, a system might declare "when button X is pressed, roll a d6 and send the message to the chat", one module might go in and say "oh, that d6 is a d8", and another might change how that chat message is formatted....

How to ignore ts error when bundling?

I run
deno bundle '.main.ts' fibery.js
deno bundle '.main.ts' fibery.js
and it refuses to work due to 41 errors. Mostly they are any type error. When debugging they run fine. Is there a way to force bundling? I add the //@ts-ignore at the top of the file but it doesn't work...