Deno

D

Deno

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

Join

Getting the client IP address with `deno serve`

I'm trying to get the IP address of the client when running declarative scripts through deno serve. It seems the fetch method only accepts the first request parameter, and if I expect and address the connInfo parameter, I get an Internal Server Error and a console output of TypeError: Cannot read properties of undefined (reading 'remoteAddr'). Are declarative scripts intended to not have access to this additional information? Or have I overlooked something?...

Using Deno core in an app that already had its own tokio runtime

I am using the deno_core and deno_ast crates to "Roll my own JavaScript runtime", as seen here (https://github.com/denoland/roll-your-own-javascript-runtime/blob/main/src/main.rs#L153-L159 ), but I don't know how to launch my deno runtime properly within my existing tokio runtime. I've tried using a Handle and spawning a thread and using block_on, like below: ```rust...

Issues with redirects and partials.

Hello, I am having some problems when I try to use partials in fresh. My partial is located in _app wrapping everything like in the example in the docs. <body f-client-nav> <Partial name="body"> <Component />...

error: TypeScript files are not supported in npm packages:

I am wondering why I cannot import a .ts file from a node_modules directory. If I could do this then I could use npm as a package manager which would allow me to take advantage of the things that I love about deno as well as being able to work with modules in a familiar way (eg. bundle templates, stylesheets, static assets, whatnot alongside the scripts). eg....

installed deno, btu not working

Hi, I installed deno on my mac. Trying to run simple Deno.serve((_request: Request) => { return new Response("Hello, world!"); }); but getting error "Cannot find name Deno"?...

Emit with dynamic imports?

Does deno emit work with dynamic imports?

Weird error with Promise<Deno.AtomicOperation>

When an async process returns a reference to an atomic operation: ```typescript const kv = await Deno.openKv(); // contrived async process: new Promise( ok=>ok(kv.atomic()) );...

denokv self host

hey guys i am try to host denokv. i have deployed a docker using image ghcr.io/denoland/denokv with following env variables. `AWS_ACCESS_KEY_ID=AKIAW.... AWS_SECRET_ACCESS_KEY=uid6Xj6.......

Deno LSP doesn't recognize workspaces as imports

For some reason the vscode plugin for deno says this code is invalid even though it runs perfectly fine via the cli. mod.ts: ```ts import { add } from "@mypackage/test"; ...

VS Code Settings

Looking for some help with VS Code settings. I just can't get rid of this error no matter what I do. Tried everything and read every github issue I could find.
No description

Deno.test with "each" support

I tried to find in docs if something like https://deno.land/x/test_each@v0.0.2 or jest's https://jestjs.io/docs/api#each exists in Deno.test Looks like it is not, if you know that I missed something or there's a common pattern of doing this in Deno.test (like idk... mapping an array into an array of asserts and somehow getting the correct message out - please steer me into the correct direction....

(node) post request stuck at pending

well so i have frontend as of react and backend of node express and mongo db in short mern stack so as i m hitting request from frontend to the api of backend it just show pending while on the different route it is working perfectly fine (/login one ) last night it was working perfectly fine but yeah this error today due to some changed did git hard push no effect so yeh thought might get help here...

Writing modules for multiple runtime ( Deno & browser ) + Monorepo setup?

Hey this Neco Founder of OSS https://craftgen.ai (https://github.com/craftgen/craftgen) So after a long thought process, I decided to settle on deno runtime for craftgen cloud runtime. now I'm trying to port my core package which works totally expected in browser to deno runtime....

Loading failed for the module with source “node:process” - island not hydrating

Access to script at 'node:process' from origin 'http://localhost:8000' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
Access to script at 'node:process' from origin 'http://localhost:8000' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
I have an island component that needs to be rendered on client only, given the following code it only renders <div>hi</div> on the server side: ```ts...
No description

preact/compat

Hi deno's AI bot, do you know how to set up preact/compat in a Fresh project?

How to resolve: http2 error: stream error detected: unspecific protocol error detected?

When I try to make a POST request using fetch in DENO I get the error mentioned in the title. The code: `async activate(company: Company): Promise<void> {...

I can't write Uint32Array on a file.

I want to write an Uint32Array type to a file, but i always have the following error:
error: Uncaught (in promise) TypeError: expected typed ArrayBufferView
error: Uncaught (in promise) TypeError: expected typed ArrayBufferView
...

A way to render code only if JS code can't be run

I noticed (at least in development), that when the app refreshes due to code change, and if I press back button to go to a previous version of the app which is no longer valid, the app doesn't work (rightfully so, because the previous iteration of the dev app no longer exists). Interestingly, I noticed that the HTML code generated by previous version of the now non-existent app, stilll works. But this previous version of the app is static HTML, and JS does not work until I refresh the app....

Is it possible to change a fresh.js project to build ahead-of-time

I cannot find the field to input the required command. Do I need to remake the project, or go into the github actions and change stuff there? Or am i just missing something obvious? Thank you in advance!:):deno_thankyou:
No description