Deno

D

Deno

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

Join

Serve a directory index with oak?

Hi, I’m wondering if anyone can help me out having Oak serve a directory index (the way apache does, for instance) if a user goes to /some/directory/path? (Sorry if this is the wrong discord, I couldn’t find one related to Oak…)

Install .tar.gz from pkg.pr.new

deno add https://pkg.pr.new/rolldown@02a65e2
error: Failed to parse package required: https://pkg.pr.new/rolldown@02a65e2
deno add https://pkg.pr.new/rolldown@02a65e2
error: Failed to parse package required: https://pkg.pr.new/rolldown@02a65e2
...

fetch does not work

I'm trying to fetch json data from API. The certificate is valid.
No description

Vendoring node_modules in Deploy?

There is a node compat issue #26733 blocking me from going live in Deno Deploy, is it possible to vendor npm packages and deploy patched versions as a workaround for the moment?

Can you override compileOptions.jsx via a flag?

I'd like to be able to change the jsx option to react-jsxdev in my start dev task, without having to alter the deno.json file. Is there a deno cmd line or env var to set this?

How to get Deno to properly resolves global types when working in a SST project?

For context I am referencing this project as an example - https://github.com/sst/sst/tree/dev/examples/aws-deno Steps to reproduce: 1. Ensure you have both node & deno installed on your machine (sst relies on node) 2. Open the project in VSCode (ensure the Deno extension installed & enabled)...

How do you update npm dependencies (e.g. with ^1.0.0) to the latest version?

Is there a command to do this, and have the lockfile update? Or do I need to manually bump all the versions in deno.jsons to force that? Or do I simply delete the lockfile and reinstall?

VSCode not tracking references

Not sure if I am doing something wrong but VSCode is not tracking references properly, which is making it difficult to "goto" code and/or remove dead code. I have tried restarting everything (including my computer) to try and reset everything, but nothing has worked For reference, I am using "asdf" to install different versions of Deno, but it is seeing the correct version indicated in the bottom right corner. Not sure if this would effect anything though... You can see in the attached screenshot that the "cacheForever" function has "0 references" even though it is used above. Also, the "serve" function is being referenced outside this file...
No description

Best practice to import internal components

Many examples show that importing with file extensions is simple, but these todo examples are not connected to real-life scenarios. In reality, components are not just a single file (they include styles, tests, and the component itself), and you typically store each component in its own folder. This leads to duplicated imports like Button/Button.tsx, which look messy. For example, my project structure is as follows: ``` /...

`deno install` installs workspace members' npm dependencies, but not jsr dependencies?

In a monorepo setup, does deno install install the dependencies of workspace members? I couldn't find any mention of this behavior in either the deno install documentation or the workspace documentation, so I'm unsure if this is the expected behavior. Consider the following monorepo structure:...

https://github.com/apache/pulsar-client-node - does it work in Deno?

I tried to include it as follows: import pulsarNode from "npm:pulsar-client"; console.log(pulsarNode);...

How to locate a deep dependency?

I have a Fresh project with some NPM dependencies. One day the following warning pops up every time the server starts: ``` Browserslist: caniuse-lite is outdated. Please run:...

Can I import/reference Deno's TypeScript when bundling types?

I have the following import in a script that uses ts-morph to pull some types from TypeScript (TypeScript is currently pulled in via package.json as an entry in devDependencies):
import { version } from 'typescript';
import { version } from 'typescript';
...

Next throwing an error that seems to be "Deno not defined"

Weird issue here, but I'm probably misusing the client/server functions somewhere. Anyway, I have this function "getScores" ```"use server" import config from '../config.json' with { type: "json" };...

How we can use deno docs theme in our project?

Hey anyone please can help us to use deno docs website lume theme in our project?

Webpack on Deno

Hi!! I’m wondering how I could use webpack and the webpack terser plugin on Deno? Thank you!!!

VSC having issues with NextJS using Deno

so I installed Deno and NextJS and have successfully run both the front and backend, but unfortunately it seems like it's throwing lots of extra errors with the tsx renderer. example error:
Relative import path "next/image" not prefixed with / or ./ or ../
hint: If you want to use a JSR or npm package, try running `deno add jsr:next/image` or `deno add npm:next/image`deno(import-prefix-missing)
Relative import path "next/image" not prefixed with / or ./ or ../
hint: If you want to use a JSR or npm package, try running `deno add jsr:next/image` or `deno add npm:next/image`deno(import-prefix-missing)
...
No description

initial '$deno task start' failed because of emoji import

Console error logs `` Watcher Process started. error: Import assertions are deprecated. Use with` keyword, instead of 'assert' keyword. ...

Deno 2.0 can't find .pem files even with --allow-read?

Hi. I just need Deno to read these .pem files for a crypto key. The paths are correct, I'm sure. My container throws an error claiming the .pem files don't exist, I'm not sure why....
No description

Need help for rendering html and css file in backend

Hi, am using deno first time. I work always on express.js. am perfectly run a deno server using npm:express. but when am gonna render some static html and css, getting error, below is my code and folder structure attached as image.
No description