Deno

D

Deno

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

Join

How to setup CORS with serve? I get 403 forbidden.

I've setup the following headers (OPTIONS response): ``` new Response(null, { status: 204, headers: { 'Access-Control-Allow-Origin': '', 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS', 'Access-Control-Allow-Headers': '' }...

Dynamic npm imports don't work

Hey there. It looks like dynamic imports don't work with npm specifiers. For example: ``` await import("npm:react")...

Vue 3 and deno

So I'm not much of a web dev myself cuz I don't really like to build websites. But now I've found vue and I'm in love with it. Only drawback is that I need to use node. Does anyone know if it's possible to use vue with deno? And if so what are the current drawbacks?...

Unable to make local session persistence with Firebase Auth on Deno Fresh

Hello I'm running a basic app for testing firebase auth. My implementation is as follows: - The firebase app is initialized in ~/back/firebase.ts using env variables for the configuration values. - The sign-in functionality is in ~/routes/api/signin, The POST method executes the signin using firebase auth and redirects to /profile. The GET method returns the current session for fetching....

newbie help on deploying first project to deno

I asked on deno github and was told to ask on discord: https://github.com/denoland/deno/discussions/16039 I wonder if someone could help me on this, im trying to deploy a mongodb nodejs project...

Custom fonts

What's the most straightforward way to supply my own fonts (.woff/.woff2) to use with Fresh and twind? Can't seem to get https://twind.dev/handbook/configuration.html#custom-fonts-and-imports to work

How to exclude vendor directory from test coverage?

https://deno.land/manual@v1.25.4/testing/coverage Here it says by default it will exclude test\.(ts|tsx|mts|js|mjs|jsx|cjs|cts) and only include specifiers matching ^file:. If I wanted to keep the current behavior but also exclude my vendor directory how would I do that? Before this I tried excluding them from codecov by using the following codecov.yml in my .github directory but it didn't work and still shows coverage for my vendor directory. ```yml comment: false...

How exactly do import maps work?

My import map works but I don't understand how!
"/": "./src/",
"./": "./",
"/": "./src/",
"./": "./",
If I import /a/b/c.js it imports from ./src/a/b/c.js. I like this....

does not provide an export named... module import

does anybody know whats going on, when i reload my page only sometimes i get this message :
The requested module './mymod.module.js' does not provide an export named 'mymod'
The requested module './mymod.module.js' does not provide an export named 'mymod'
when i import like this ...

Write to virtual file path

Is it possible to provide virtual file paths so that another package writes a file to a variable in memory or to stdout? I'm using esbuild.build({ ... }) and I want to take the output of that and give it straight to deno, as in deno run esbuild.js | deno run -. I could solve the problem by writing to a temp file and running that....

Request.body.getReader() into Uint8Array typed array

is it possible to convert a readableStream into a Uint8Array ?

serving two static folders and connecting to both with websockets

A lot of the youtube and medium resources available on setting serving static folders, and on setting up a websockets server, seem to be using patterns that are not compatible with each other / not harmonious with the latest version of std etc. I have a few stumbling blocks. The first is to serve my 'public' folder to the url, and serve another folder, called 'control', to URL/control, but within the one serve () call. Using a switch statement seems to break everything and I don't really understand why. Eg, ```js...

i need a regex that matches, from a double quote to a double quote and has two fullstop between it.

i need a regex that matches, from a " to a " and has two . between it for example, "fjhhdjkdj.s28e7d.podk"...

deno run --watch

So I'm trying to use deno run --watch but I only want it to reload if certain files have been changed. Is there any way that's possible? I couldn't find anything anywhere

Twind config [Fresh]

Is there a workaround for custom twind colors getting flagged as problems by vscode?

import a locel module from a webmodule

I have a module that i inport into my local scope and that module should also import a module from my local scope and not from its url , is this possible ?

Switching to forums for help

The old channel is at #old-help and will be archived in a few days.