Deno

D

Deno

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

Join

reflect-metadata on Deno Deploy not working?

Is there a reason why no reflect-metadata-libs work on deno deploy? I have tried the following: - https://www.npmjs.com/package/@abraham/reflection - https://deno.land/x/reflect_metadata@v0.1.12-2...

`deno run` not returning

Hi - I have added the following code to my javascript file, and for some reason the code still executes fine, but it doesn't return anymore, leaving deno running and I have to ctrl-c out of it. ```js if ("Deno" in window) { // Import paper_js, as it is not loaded by the index.html script include...

npm specifier not found in LSP only, and so no types for certain imports

It seems to be unfixable (via cache reload, deno info, reboot, rm -rf ~/.cache/deno, ext.), so right now the LSP is unusable and I'm writing JS with no types. deno run, deno check, deno info and deno cache --reload, all run without error and don't complain about the missing specifier like in the LSP. e.g. importing drizzle-orm and no types are available. output I see when I run cache and it's dependencies:
Could not set npm package requirements. Error getting response at https://registry.npmjs.org/@types/node for package "@types/node": An npm specifier not found in cache: "@types/node", --cached-only is specified.
Could not set npm package requirements. Error getting response at https://registry.npmjs.org/@types/node for package "@types/node": An npm specifier not found in cache: "@types/node", --cached-only is specified.
...
No description

localhost workflow for BroadcastChannel?

How would one go about setting up a (multiple?) localhost workflow for implementing / testing BroadcastChannel things?

jsxImportSourceTypes not working for React

I've tried doing this: ``` "jsx": "react-jsx", "jsxImportSource": "react",...

Take data from a ts file to display it in the html

How can I take data from a ts file to display it in the html? Like a search bar. Is it possible to do this in Deno Fresh? Thanks in advance...

https imports in vite project

I want to develop my svelteKit app in deno and need to add a SQLite-module. Doing it like this:
import { DB } from "https://deno.land/x/sqlite/mod.ts";
import { DB } from "https://deno.land/x/sqlite/mod.ts";
...

SvelteKit: Unable to load a local module for './$types'

The ./$types module resolves just fine in my .svelte files but not in .ts-routes. Any idea how to fix this?

Piping stdout from a ChildProcess while it's running

Is it possible in Deno to read from a ChildProcess's stdout while it is running (before it has completed)? I'm using deno.Command and .spawn() to create a ChildProcess.
If I then try reading from process.stdout.getReader() it does not return anything until the process has terminated and an output status is returned. ...

PHP to Javscript little code

```php if ($_SERVER["REQUEST_METHOD"] == "POST") { if (isset($_FILES["file"])) { $file= $_FILES["file"]; }...

SpeechRecognition is not found

There are other SpeechRecognition interfaces, but the main one isn't available.
No description

Ignoring `deno(redirect)` in vscode?

When deno extension in vscode is enabled, i get this warning, that my imported file was redirected. I know, that this is probably a bad practise, but this is what i want to have. So is it possible to just hide this squiggles? I couldn't really find anything in the extension's settings
No description

Adding a max runtime timeout to Deno JS execution

As the title states, I would like to be able to add a timeout to any JS code that I am executing in my deno_core JsRuntime in rust. I haven't been able to find any way to get this to work as all solutions seem to require that Deno yields the async runtime which it doesn't ever seem to do until it finishes. Any advice you could give or places you could point to would be extremely helpful, thanks!

Do you know how I can call a C variadic function in FFI Deno?

I want to call a C variadic function from Deno but I looked at the documentation and it doesn't seem possible. Solutions ? Thanks in advance.

KV watch prefix?

Is there a way to watch a prefix. I would like to be able to watch for any record added to a specific key prefix. ``` export async function logData(jsonObject: Object) {...

Deno LSP Issue with import maps?

I've been using an import map throughout my project like this: deno.json file at the projects' root that has a map like this: ```{ "imports": { "atlas": "https://deno.land/x/atlas_sdk@v1.1.1/mod.ts",...

Using `Deno.FsFile.prototype.readable` with `Response`

I was trying to stream a file into a response with the snippet: ```ts const file = await Deno.open(path); const resp = new Response(file.readable); file.close();...

react-helmet-async missing HelmetProvider export

I'm on the canary version testing out jsxImportSourceTypes and ran into an issue when switching to using npm specifiers for react@18.0.2. I have the following entry in my deno.jsonc imports.
"react-helmet-async": "npm:react-helmet-async@2",
"react-helmet-async": "npm:react-helmet-async@2",
My editor has no issue showing that it recognizes the HelmetProvider. You can see in the attached screenshots that it is recognizing that I'm importing the class. However, when my code runs, I get the following error....
No description