Deno

D

Deno

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

Join

Unexpected token 'export' (deno_core)

Playing around with ModuleLoaders, but doesn't seem to make a difference Scripts containing the export keyword don't load due to above error How can I allow the keyword?...

global is not defined

Why Deno doesn't have global like node.js? There is globalThis, but some things from npm packages are based exactly on global, which can cause problems (as it happened to me) This happened to me when I tried to use the Array type from mongoose (import { Types } from "mongoose"). This is an extended version of array, which inherits an array from global.Array, which works in deno as an inheritance from undefined...

Using querySelector on Node

I am doing something like: ```ts const nodeList: NodeList = document.querySelectorAll(".foo"); const nodes = [...nodeList]; const result = nodes.map((n: Node) => n.querySelector("span"));...

Are there any plans to support an equivalent to emitDecoratorMetadata?

That's it really... I appreciate that Deno doesn't emit anything, so the option would be different, but access to metadata in decorators is incredibly useful for things like DI and other cross-cutting concerns....

Simpler way to read a file relative to current module?

So I wrote a little helper function for reading the text content of a file relative to the current module. I came up with the following, but is there any simpler way that I'm missing? It seems a bit wordy 😄 ```ts import * as path from "std//path/mod.ts"; ...

error: BadResource: Bad resource ID

I'm writing tests for https://github.com/deno-libs/tinyhttp/pull/9. ```js import { describe, expect, it, run } from 'https://deno.land/x/tincan@1.0.1/mod.ts' import { App } from '../../app.ts'...

Recent deployment not working?

Hi there I have an api that was working just fine not sure what happen but new deployments are not working, on my local works, and the deployment from 5 days ago works, but any new deployment don't I'm using the pusher library with esm.sh, just wonder if anything changed recently 👀 I mean the deployment works** but the code endpoint dont not sure why we didnt change the code...

How do you get the path to a file relative to the module which is referencing it?

const GET_PROGRAM_QUERY = Deno.readFileSync("./GetProgram.gql");
const GET_PROGRAM_QUERY = Deno.readFileSync("./GetProgram.gql");
GetProgram.gql is a file in the same directory as the calling module. The above doesn't work. Any ideas?...

Investigating memory leak after adding new app dependency

Hi, I added an OpenTelemetry metrics reporting loop to a Deno program and found that Deno began leaking memory (300MB+, until it hits OOM and gets killed). This program was previously stable at 40MB RAM usage. To begin, I graphed Deno.memoryUsage() and it seems like the leaked memory is all external. How else can I investigate the issue? Anything else I can add to my typescript to observe this?...

VScode deno lint blew up again after update.

It seems every time there's an extension update VScode lint blows up and will stop recognizing top level awaits, and all kinds of other things. How can I fix the latest one?

Help debugging command that doesn't exit.

Is there a way to have Deno tell me what async tasks are still pending when a program ends? I'm using a third-party API, and AFAICT awaiting all the promises I can, but I still get to the end of my main() and deno doesn't exit. So I've got: ...

import cache not working

I can't install cache of my http imports:

Why isn't this error caught?

Basic code example: ``` try { Deno.remove("fakefile"); } catch (err) {...

client side JS

If I am using "lodash" on the client side, do I need to have a path for the browser to get it from NPM repository the way I wold if I wasn't using deno?

Using dynamic import with npm compatibility gives intermittent error "__DENO_NODE_GLOBAL_THIS_167935

This is pretty hard to google because the number at the end of the error changes everytime it happens, but basically: is this a known issue? I'll run some code (in a worker, using dynamic import pointing to npm: or a CDN and get ReferenceError: __DENO_NODE_GLOBAL_… on the first and sometimes second run, but after that it'll work.

Graphql codegen

does anyone have a solution to generate the sdk using graphq-request with Deno?

Deno Third Party Modules Web Hooks

Is there a way to see the webhook payload URL a package you have published is listening for?...

Does Deno package.json support use workspaces for module resolution?

Talking about this field: https://docs.npmjs.com/cli/v9/using-npm/workspaces If not could I somehow link to a local package in a project while it would resolve to the published version in deploy/publish context?...

Does Deno Deploy support location based analytics?

The free version does not seem to support it. Does the paid version support it?

Fresh: How to make Styles global with twindv1?

With the new twind-Plugin (v1), does anybody know how to do global styles? It was preflight before, but it does not seem to work like that anymore. I am trying for quite some time now to use injectGlobal and searching about both versions (through repos, documentations and forums) but I can not make it. Does anyone have an example or a suggestion do it in another way? 🥺 A solution would safe me hours of trial-and-error....