Deno

D

Deno

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

Join

Best practice for passing Array of Objects from C++ to TS using FFI

Hey, what is the best way to pass an array of objects from C++ via DLL to TS? We are trying to write a Serial Library and we query a list of available ports and their information. Similar to the serialport.io node library. What would be the best way to pass all the available ports and their information to TS?...

Workaround for deno with otel not exiting?

https://github.com/denoland/deno/issues/29590 I kinda want to use otel but if i cant exit the application it won't be of much use...

dist folder causes issues with React version

I had an issue where this error kept cropping up. ``` react.development.js:496 Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM)...

deno fmt vs prettier

How can I use deno fmt to combine empty braces together, similar to prettier? e.g. ```...

How can I make Vite and Deno path aliases cooperate?

I’m working on a project that uses both Deno and Vite, and I’m running into trouble getting their path alias systems to work together. For example, I have an alias like ‎~ mapped to ‎src/ in my Vite config, so imports like ‎~/integrations/query/todos.tsx work fine in the Vite dev server. However, Vite doesn’t recognize this alias, so running or linting the code with Deno fails to resolve the same imports. I’ve tried configuring aliases in both ‎vite.config.ts and ‎deno.json, but they don’t seem to share or respect each other’s settings....
No description

Lint does not ignore `**/*.gen.ts` files as expected

I’m trying to configure Deno’s linter to ignore all files matching ‎**/*.gen.ts. I have a hard time making it ignore generated files. Here’s the relevant part of my ‎deno.json: ``` {...
No description

Running npm modules via deno eval, prettier vs jsvu

What is the correct way to run npm:jsvu via deno eval? fwiw, the npm prettier way is: deno eval 'import("npm:prettier/internal/cli.mjs").then(cli => cli.run(Deno.args));' -- <prettier parameters>...

Node compat: Drizzle Kit - Dynamic require of "fs" is not supported

Try this:
import { generateDrizzleJson } from "npm:drizzle-kit/api";
import { generateDrizzleJson } from "npm:drizzle-kit/api";
...

How to `deno bundle` to single TypeScript file?

Hi there, first of all thanks a lot for this awesome project. I'm really happy to get back deno bundle. On the Blogpost https://deno.com/blog/v2.4#deno-bundle the author mentioned that deno bundle is for......

Tried creating new organization(s) to test new Deploy EA... but timed out everytime

It now says that the organizations names are already in use, but I suspect it's in use by my failed attempt at creating the org. Is there a way to regain access to those ?...

why my account has blocked?

I have deployed some of my application services normally and have been using them normally before. Today, it suddenly prompts that my user has been blocked. What is the reason? I did not use it to build a VPN, so why was it blocked?

Migrate very big hybrid project to Deno

Hey folks! I'm trying to figure out if we can migrate our 6M LOC from Node to Deno. A year ago it was fully commonjs, but when I joined the company I was stupefied by that and started a project to migrate it to Typescript. Nowadays about 30% of the codebase is written in Typescript (ESM) while the rest is in Javascript (CommonJS). We currently use a mix of SWC and Babel to transpile and bundle the code and the tests. I started playing with Deno but realized it can only handle either fully CommonJS (meaning it won't recognize ESM files exist) or ESM (meaning it will break when seeing any require). That is unless I rename all thousands of JS files to .cjs in order for Deno to know that they're CommonJS. My question - is there a way to configure Deno to treat all .js files as CommonJS and all .ts files as ESM modules?...

Finalize dgram compatibility API (add/dropMembership mainly) to allow matter.js to work

Hello everyone, my nme is Ingo and I am the lead developer fo matter.js, the Matter JavaScript SDK. We are currently trying to extend the number of JavaScript environments where matter.js runs on. Currently we are at Node.js, Bun, and also Electron seems to work. I would love to also set Deno on that list because I would assume that there are some memory footprint enhancements compared to the other ones. For this I wanted to ask if someone of the contributors would have time to look into reactivating/recreating https://github.com/denoland/deno/pull/26452 to enhance the dgram compatibility APIs - mainly in regard to add/dropMembership - because this is the main "Blocker" to also allow matter.js to be executed with Deno ... 🙂...

Memory profiling

What's the best way to profile code to figure out if I'm having a deno, library or host issue? I have roughly the same code running in the browser as some dockerized deno but keep OOMing. My logs are less than useful and I'd love to figure out some memory profiling. The package I'm using is written for node and has some quirks in deno. I need to investigate if my code needs or if I need to write a formal deno package....

Does Deno Compile Support Deno Serve --parallel?

Hi, I was reading the documentation and Deno Serve mentions the --parallel option but Deno Compile isn't very clear. It says that runtime flags can just be attached when calling compile, but --parallel is only an option for deno serve and not deno run. If I'm compiling a server calling Deno.serve, will the compiler know to automatically read executing the binary as essentially calling "deno serve" instead of calling "deno run"? Or to run deno serve in parallel are you essentially required to run it uncompiled? Might be good to add to the deno compile page either way. Thanks!...

Deno Aliases

When I run my tests I get the following example error:
error: Relative import path "@services/chain/types/chain_types.ts" not prefixed with / or ./ or ../
at file:///workspaces/maicro/backend/test/1000.config.and.files/1000.config.test.ts:6:26
error: Relative import path "@services/chain/types/chain_types.ts" not prefixed with / or ./ or ../
at file:///workspaces/maicro/backend/test/1000.config.and.files/1000.config.test.ts:6:26
...
No description

Deno.server get request ip

Last message i see in help section is about one year ago or so. And still no way to do this without brainfuck? are you serious?

Is Deno's new Request missing implementation of Fetch Spec steps 13-21, leading to Issue #27763?

In Deno, the new Request implementation appears to be missing steps 13 to 21 as specified in the Fetch Standard. Is this intentional? I believe this is the reason behind the issue opened at https://github.com/denoland/deno/issues/27763.

Deno language server no longer starting. "Fatal JavaScript out of memory: Reached heap limit" error

I'm encountering an issue wherein the deno language server keeps crashing for some reason and I can't seem to figure out why