Deno

D

Deno

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

Join

Cannot deploy properly to deno deploy

So I've just run a simple next js starter from the deno documentation and wanted to deploy it to deno deploy to see how this workflow is compared to vercel. However I'm getting permission denied and all sorts of other errors, any idea what went wrong? ``` PermissionDenied: 'Deno.exit' is not allowed in this context. at Object.exit (ext:deno_deploy/os.js:69:9)...

Zed code completion

Does anyone uses Zed with auto completion for Deno as in: https://zed.dev/docs/languages/deno My config: ``` "lsp": {...

Separate importmap file for static website

I have a folder in my Deno app for a static Website. The content could look like this: ```html // index.html <!DOCTYPE html>...

Deno 2 compatibility with TanStackRouter vite plugin

Hello I was wondering if anyone has experienced issues running a react app with vite and tanstack router on new deno 2. I get error that I could not register module when I try to run these together

workspace members without version (or prelease version) in package.json don't get installed

I'm migrating a monorepo from bun to deno and saw that several of my packages can't be resolved. As it turned out the packages in question didn't had a "version" field in their package.json or had a prerelease (e.g. "1.0.0-alpha.1"), so they did not end up in the root "node_modules" folder. Am I missing something here? Is this a known restriction? I cannot simply change the version. Thanks in advance...

Dynamic import with absolute path outside of project directory

Dynamic Importing seems to only work relative to the current projects directory, but I want to load things from outside the project directory. As you can see, p is resolved to cwd + location, but I just want it to be location. Is it this possible, or do I have to bring all possible modules under the project directory? `` const location = "C:\\Users\\me\\modules\\mod1\\mod1.ts"; const importLocation = new URL( File://${location}`,...

error: deno task couldn't find deno.json(c) on GitHub Action

This GitHub workflow: ```yaml name: Chạy định kỳ on: workflow_dispatch:...

Run JSR library from NPX

I have built a package that uses Deno internals at https://jsr.io/@aminnairi/tsconfig@0.2.0 but I'm having issues run this package from NPX as per the documentation. Using the npx jsr run @aminnairi/tsconfig command does not work, same thing when used with npx jsr run jsr:@aminnairi/tsconfig. Am I missing something? The command deno run -A jsr:@aminnairi/tsconfig works though....

Exclude packages from test coverage

Hi, I would like to exclude the packages from the coverage when I run deno test --coverage. Currently I also get generated jsons inside coverage directory with url like this: "url": "file:///Users/johndoe/Workspace/Dev/lld-test/node_modules/.deno/wawoff2@2.0.1/node_modules/wawoff2/decompress.js"", How do I avoid it? Note that I have it excluded in my deno.json as:...

Cannot find module 'drizzle-kit'

Hi, I'm following this Deno guide to add Drizzle to my Deno application. I'm starting from scratch, so I don't have any tables in my Postgres DB. When I get to the point where I need to run deno -A npm:drizzle-kit generate, I get the following error: ``` No config path provided, using default 'drizzle.config.ts' Reading config file '/Users/<my-username>/Dev/tba/tba-api/drizzle.config.ts'...

Types for global variables

I have defined a global variable: globalThis.Args = validateArguments(Deno.args); Now whenever I use it I get TS error: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.deno-ts(7017) How can I fix this?...

Is it reasonable to import TypeScript source from Github instead of compiled NPM library? (Twurple)

This might not be the place, but I'm brain dead and soon going to bed, so here goes. Today I tried to get Twurple working in Deno as I want a premade library for Twitch, but I can't for the life of me get types working when importing it from NPM, it just doesn't do anything while I got Discord.js to work just fine. But, the whole project is written in TypeScript on Github, so, would it be a valid path to pursue and include the source of the project directly? I believe I read that Deno can import directly from Github, with that I hope types have a higher chance of working. I might have to try and import the right folder in the repository though, not sure if that kind of granularity is possible....

Importing from Deno Workspace to NPM workspace

I'm trying to import some shared Zod schemas from the backend (Deno project) to the frontend (React project created using deno run -A npm:create-vite) but for some reasons, the LSP finds the file correctly, but it is typed as any rather than the type of the Zod schema. I tried creating a shared folder and importing the schemas from the shared folder to the backend and it works perfectly, but importing it from the frontend always gives me any. Any insights on this? I tried both on helix and vscode, same outcome....

How to build WASM from Rust?

Following MDN's WASM tutorial I've built a wasm that runs in the browser. Importing the generated wasm.js works fine, when I try to import the wasm_bg.wasm directly, it throws this error. ``` Uncaught TypeError: Relative import path "wbindgen_placeholder" not prefixed with / or ./ or ../...
No description

why deno vs code extension not supporting deno test describe and coverage?

While developing with vs code in vs code native test explorer it shows tests while we run deno test but it's not showing test written with describe, why? and also it's not shoing coverage of files in native vs code test explorer, how to solve this?...

Running globally installed packages with permission flags

I globally install something like solc, but then it needs read permissions. But since it's run with solc directly, (not deno) because it gets installed into the deno bin dir, I cannot pass flags to it, like allow-read etc. What is the way to pass flags to Deno if you're running a globally installed tool in its bin?

Managing releases

Hi everyone, I am not very experience in the topic, just pick up recently Deno and I wanted to know whats the correct way of handling releases, is there a "best way to go" library for it or whats the proper way to do it on a Deno project.

Equivalent of tsconfig `includes`

I'm setting up a sveltekit project in deno svelte and sveltekit make a lot of use of ambient declarations to provide types for things which are not implemented in javascript, but instead they're injected or mapped at compiletime usually, the includes are managed by sveltekit itself, creating a .svelte-kit/tsconfig.json file with the populated includes, which your root tsconfig.json extends from...

Using JsRuntime in an async context

Hiya! I'm trying to use deno_core::JsRuntime in an async block, but I'm running into issues as the module loader of RuntimeOptions is wrapped in an Rc. Would anyone know a way to get around this, while still being able to load modules from the filesystem?