Deno

D

Deno

Join the community to ask questions about Deno and get answers from other members.

Join

How to load fonts in /static?

Using Fresh with tailwind By doing ```css @font-face {...

How do i correctly create local package/package.json - that can be used by locally running deno app?

The tl;dr is that I have a sveltekit app and a deno app, and they both share code. Everything seems to work on the CLI level, but I cannot get it to work on the LSP level (vscode) I think? I can't tell if it's my lack of understanding of how deno expects imported npm packages that are local - or if that's even possible, or something else. I have put up a mock repo to show what I am trying to do, and I also creted an issue in github that shows some fix attempts that lead to extremem performance degredation from the deno lang server (i think at least) I'm trying to figure out how to structure a node package and what the package.json should look like in order to correctly be able to reference this package from a deno app using an import_map...

Install package provided from URL as `.tar.gz`

Some sites like https://github.com/stackblitz-labs/pkg.pr.new provide packages as tarballs. How can these be installed in a deno project? With npm, we can simply run npm i https://pkg.pr.new/<owner>/<repo>/<npm-package-name>@<pr-id> and the PR branch version of the package will be installed. Does deno have a way of handling this?...

Importing Tesseract.js

Hello! I am hoping to use tesseract.js to do OCR in my application. However on deno 2.2.6, when I try ``` Tesseract.recognize( 'https://tesseract.projectnaptha.com/img/eng_bw.png',...

How do I compute a cursor for kv.list?

I basically I want to list entries after a known key. I'm trying to implement this function: function getEvents(afterEventId: string) { const entries = db.list({ prefix: ["events"] }, { cursor: ??? } ...

deno.json glob exports

I am using a monorepo with multiple projects. I would like to use specific files from package @namespace/toolbox in package @namespace/project. In package toolbox, I have the following deno.jsonc: ```json...

Socket failing to transmit/receive when using 'upgrade' event and socket.write on Expressjs server

Hi, I'm using the ws npm module with my Express server (lots of routes were imported from a different project, one using Node with express in mind). Use of either socket.end or socket.write hangs the request. The event listener is attached to the Server given by app.listen(). The script with this bug commented out is here (ctrl+f for 'upgrade'): https://gitea.proxnet.dev/zombieb/galvanic-corrosion/src/branch/master/src/main.ts...

Cannot use daisyui as a tailwind plugin

Hi, when trying to add a component library to a completely new deno install I came across a problem. I added screenshots to show the problem...
No description

Selective package.json Discovery in Monorepos

Hey Deno community! 👋 I'm working with a monorepo that contains both Deno-compatible shared libraries and non-Deno projects (like Expo/React Native). I've run into an issue where Deno discovers and tries to install dependencies from ALL package.json files in the workspace: ``` DEBUG RS - deno_config::workspace::discovery:278 - package.json file found at '/path/to/monorepo/package.json' ...

Express and WebSocket server on one port

Hi, I'm using Expressjs in my application. I need to handle websockets and the Express routes on one port. I know this can easily be done with Node, but how can I do it on Deno? I can't switch away from Express, but I can start from scratch with any websocket library. I'm using app.listen(port) in my code....

Running deno add npm:xxx via docker results in not found

So, in an experiment to run most things via docker to isolate stuff on my system I'm trying to run Deno via docker. I have a very simple shell script file, /opt/bin/deno like this: ``` #!/bin/sh ...

Check dependencies version

Hi I am new to Deno. I mostly work in highly regulated industries, so part of my development and maintenance workflow is to frequently and automatically check if any dependencies are out of date....

about prod & dev dependencies in deno projects

What are best practices for managing prod/dev dependencies in a clear separate manner with deno? 1. Without workspaces? 2. With workspaces? 3. Using import_map.json (both cases)? 4. Is a separate dev_import_map.json recommended?...

commonjs overrides

I'm trying to migrate to deno and most things are working, which is awesome. However, i have some older dependencies that are published in commonjs that I need to override their dependencies (overriding react specifically). Previously i achieved this with npm overrides, but that's not working with deno.

Does deno.json have something similar to engine in the package.json

I want to make sure a certain version of Deno is being used by developers

Importing local workspace React components into Vite project not working

On this project https://github.com/danm/deno-srp-base/tree/main/packages/web I am trying to import a package called Articles, which is a React JSX component, into a package called Core, which is another React component, but the one which runs using Vite. The repo uses workspaces, and the Articles package has the name @srp/web-articles. When i try to import it, React throws an error:...

Problems with Nested deno.json in Deno Workspaces

Hello , I'm encountering an issue in Deno workspaces with nested deno.json files. As reported in my GitHub issue [https://github.com/StaytunedLLP/open_poc/issues/4], adding deno.json inside subfolders (like feature folders fe_ and sy_ within workspace packages) leads to red squiggles and broken import navigation in VS Code (using the Deno extension). The code runs correctly, but the editor experience is really suffering. I'm wondering if anyone can offer guidance on:...

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)...
Next