Deno

D

Deno

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

Join

Issues with libuv and zeromq support in Deno?

I was creating a deno proxy server to communicate with my python microservices which extensively use zeromq to communicate with each other, But on Deno I cannot set up zeromq no matter what, this is the error I get with using npm:zeromq package.
deno: symbol lookup error: /home/user/projects/data-proxy/node_modules/.deno/zeromq@6.3.0/node_modules/zeromq/build/linux/x64/node/115/addon.node: undefined symbol: uv_unref
deno: symbol lookup error: /home/user/projects/data-proxy/node_modules/.deno/zeromq@6.3.0/node_modules/zeromq/build/linux/x64/node/115/addon.node: undefined symbol: uv_unref
...

Workspace-aware path imports

Hi! My use case: I want to import a package from a Deno workspace. It doesn't work: - Simply specifying path to the package root or its deno.jsonc doesn't work...

JSX config not working properly, I keep getting children props error in all my components

Property 'children' is missing in type '{ in: true; timeout: number; }' but required in type 'FadeProps'.deno-ts(2741) I have similar project with same configs with npm and node and it works fine, but I can't seem to make it work with deno. Here's my deno.json and tsconfig.json (I also tried adding same configs in tsconfig.node.json and tsconfig.app.json also has similar settings)...

npm:@triton-one/yellowstone-grpc4: "This expression is not constructable"

Hey all, I'm attempting to import a class from a default export named "Client" from this npm package named "@triton-one/yellowstone-grpc4", however trying to construct it gives an error saying it's not constructable. Checking the type definition file, the class looks like it's being exported properly, and does contain a constructor. Here's a minimal example to reproduce the issue: ```ts...

Firebase: broken pipe when using npm

Hi, I've been playing around with Deno and Firebase/Firestore, put together a short script: ```js import "https://deno.land/x/xhr@0.4.3/mod.ts"; import { deleteApp, initializeApp } from "npm:firebase/app";...

Type sharing between Deno server and Expo app not working

Hi all! 👋 I'm trying to share tRPC types between a Deno server and an Expo React Native app in a monorepo. My Deno server exports a fully-typed AppRouter for its tRPC routes, and I want the Expo client to import that type directly so that any changes in the backend are immediately reflected in the client's type checking. However, while everything works at runtime, TypeScript in the Expo client resolves the imported AppRouter as any, which means I'm not catching type errors as expected. I really wanted to give Deno a try, but if I can't resolve this issue, I might have to consider migrating to Node. Has anyone encountered this problem or found a workaround?...

JSR Publish error

Anyone else getting publish errors on JSR? Internal Server Error (internalServerError)[x-deno-ray: bb8f26549d1cca79dcb0856dda0b140b] Publishes are just hanging in queued state...
No description

How to inspect Deno's rare uncaught rejections?

I'm encountering an AbortError with Deno.serve, but it's difficult to report the issue since I can't reliably reproduce it. Based on the stack trace, I can't seem to catch the error, as there’s no clear interception point. How can I investigate and debug this? ``` Task run deno run -A mod.ts --path=dav --meta-touch --debug...

Confusing linting

Getting the following warning: deno-ts: This member must have an 'override' modifier because it overrides a member in the base class 'the class name' Then I add the override: deno-ts: This member cannot have an 'override' modifier because it's containing class 'the class name' does not extend another class...

Trying to deploy fresh project to deno, and all the JS has 500 errors

Brand new fresh based project which works fine locally. Published to Deploy and no errors - home page loads fine but none of the JS loads... all of it has a 500 in the network tab and if I try open the JS directly I get "An error occurred during route handling or page rendering." Nothing in the deploy logs either... but stuck on what to try next...

How to build/cache deno program ahead of time

Hey folks! New Deno user here, really loving it so far! I've built a service that involves a Worker. The Worker is reponsible for executing some provided code. The Worker is terminated after a timeout if it's taking too long. I have a problem that the Worker always takes too long on the first execution of the program – both right after it's been deployed, or locally when running the test suite. In subsequent executions it's as fast as you'd expect. How can I cache the program ahead of time? I thought thats what deno cache does, as its help string says "Download and compile a module with all of its static dependencies and save them in the local cache, without running any code", but its docs link (https://docs.deno.com/go/cache) redirects to the docs for deno install , and running deno cache on my src/main.ts and src/worker.ts doesn't have any effect on the problem I'm having....

how to install and use framer motion in fresh js

Uncaught (in promise) TypeError: Could not find package 'react' from referrer 'file:///home/work/Documents/fresh/test-app-fresh/node_modules/.deno/framer-motion@12.5.0/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs'. const manifest = (await import(toFileUrl(join(dir, "fresh.gen.ts")).href)) ^ at async dev (https://deno.land/x/fresh@1.7.3/src/dev/dev_command.ts:38:21) at async file:///home/work/Documents/fresh/test-app-fresh/dev.ts:8:1...

Deno `fetch()` SSRF prevention: Best practices for user-supplied URLs?

What are the best practices for preventing SSRF vulnerabilities when using the fetch() API in Deno, especially when the input URL for fetch() needs to be arbitrarily received from users? I understand that using a whitelist for allowed hosts is a good starting point, but I'm looking for a more comprehensive approach. Are there any specific Deno APIs or techniques to effectively block internal IP addresses, limit URL schemes, prevent DNS rebinding attacks, or handle redirects securely? Any example code snippets would be greatly appreciated!...

Deno in Jupyter Notebook: Run cells with --check

I would like to be able to run cells with --check enabled, like you would with a file deno run --check file.ts. Currently, running cells in Jupyter notebook with the Deno kernel will not check types and will succeed even if there are type errors, just how the default behaviour of deno run is to not check types. I would like cells with type errors to fail when I run them. Is there any way to do this? Thanks!

Deno permissions and security

Hello I see that deno provides allow net and filesystem - how can i restrict these things based on the file and not blanket on the sandbox? I.e. i have my code and user code - i want to restrict user code but allow my code to have access - user code may use apis defined in my code...

Deno.connect failed to read all bytes when connected to smtp #help

After sending "HELLO EXAMPLE.COM" It should receive many lines of text i.e 250 first string 250 second string The reader only returns the first string....

is it possible to use deno std libraries that are "browser compatible" via npm?

hello i am currently working with yarn+vite project for a small website project. i want to use this base64 library: https://github.com/denoland/std/blob/main/encoding/base64.ts in my project, but i'm having trouble figuring out if this is possible through npm: https://github.com/denoland/std/issues/641...

Unable to run Deno plugin within Webstorm

Webstorm version 2024.3.5 Deno plugin version 243.22562.13 My project's deno.json is located in ...
No description

Deno env vars

In a Deno/Fresh app I have a config file that provides access to env vars, however when I try to run my migrations via
deno run --env-file=.env db:migrate:latest
deno run --env-file=.env db:migrate:latest
...

Is there a way to handle permission prompts from a worker?

I would like to give a worker net/import access to any public IP over https, without giving it the ability to bind to any address or access private IP addresses. The docstring for the net property on the deno.permissions worker option says if set to string[], the net permission will be requested with the specified host strings with the format "<host>[:<port>].", and hooking that seems like the easiest way to do this kind of permission filtering logic, but I can't figure out how to.